- clang h743 build and run cdc_msc ok
- switch unit test back to gcc, since path to clang conflict on local setup (x86 and arm)
This commit is contained in:
@@ -108,6 +108,25 @@ TU_ATTR_USED int sys_read (int fhdl, char *buf, size_t count) {
|
||||
// st->st_mode = S_IFCHR;
|
||||
//}
|
||||
|
||||
// Clang use picolibc
|
||||
#if defined(__clang__)
|
||||
static int cl_putc(char c, FILE *f) {
|
||||
(void) f;
|
||||
return sys_write(0, &c, 1);
|
||||
}
|
||||
|
||||
static int cl_getc(FILE* f) {
|
||||
(void) f;
|
||||
char c;
|
||||
return sys_read(0, &c, 1) > 0 ? c : -1;
|
||||
}
|
||||
|
||||
static FILE __stdio = FDEV_SETUP_STREAM(cl_putc, cl_getc, NULL, _FDEV_SETUP_RW);
|
||||
FILE *const stdin = &__stdio;
|
||||
__strong_reference(stdin, stdout);
|
||||
__strong_reference(stdin, stderr);
|
||||
#endif
|
||||
|
||||
int board_getchar(void) {
|
||||
char c;
|
||||
return (sys_read(0, &c, 1) > 0) ? (int) c : (-1);
|
||||
|
Reference in New Issue
Block a user