blob: 1256173480f108183cbc7790011e8ef58cc3c561 [file] [log] [blame]
PulkoMandy58ea04f2021-09-20 22:57:30 +02001/* printf in "CLib" will call printf_hook.
2 _SemiPrintf makes IDE can hook "printf" action.
3 User don't want to hook "printf" when __OPTIMIZE__.
4 function prototype:
5 void printf_hook (unsigned long lptr, unsigned int size); */
6#ifndef __OPTIMIZE__
7asm (".code
8.public _SemiPrintf
9.public _printf_hook
10_printf_hook: .proc
11_SemiPrintf:
12 retf
13 .endp
14");
15#else
16asm (".code
17.public _printf_hook
18_printf_hook: .proc
19 retf
20 .endp
21");
22#endif
23
24/* Be compatible with old project, user can remove them in new project. */
25void printf_init (int x)
26{
27 return;
28}
29void printf_end (void)
30{
31 return;
32}
33
34/* printf in "CLib" will call putchar.
35 user can implement this function -- send a char to UART? */
36int putchar (int c)
37{
38 return c;
39}
40
41/* malloc in "LibMem" will call malloc_lock/malloc_unlock.
42 if user's project has multitask, they should be implemented. */
43void _malloc_lock (void)
44{
45 return;
46}
47void _malloc_unlock (void)
48{
49 return;
50}