Skip to content

Commit 9ed2e1e

Browse files
committed
Add am_pal_flush()
1 parent add18a2 commit 9ed2e1e

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

libs/pal/pal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void am_pal_sleep_ticks(int domain, int ticks);
8080
void am_pal_sleep_ms(int ms);
8181

8282
AM_PRINTF(1, 2) int am_pal_printf(const char *fmt, ...);
83+
void am_pal_flush(void);
8384

8485
#ifdef __cplusplus
8586
}

libs/pal/posix/pal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ int am_pal_printf(const char *fmt, ...) {
327327
return rc;
328328
}
329329

330+
void am_pal_flush(void) { fflush(stdout); }
331+
330332
void am_pal_ctor(void) {}
331333

332334
void am_pal_dtor(void) {

libs/pal/stubs/pal.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,15 @@ void am_pal_sleep_ticks(int domain, int ticks) {
7878
}
7979

8080
void am_pal_sleep_ms(int ms) { (void)ms; }
81+
82+
int am_pal_task_own_id(void) { return -1; }
83+
84+
AM_PRINTF(1, 2) int am_pal_printf(const char *fmt, ...) {
85+
va_list args;
86+
va_start(args, fmt);
87+
int rc = vprintf(fmt, args);
88+
va_end(args);
89+
return rc;
90+
}
91+
92+
void am_pal_flush(void) {}

0 commit comments

Comments
 (0)