forked from espressif/arduino-esp32
optimize log facility for multi threading
- Shorten filenames - Add log_printf with mutex locking to play nice with Serial and two cores
This commit is contained in:
@ -47,4 +47,18 @@ void delayMicroseconds(uint32_t us)
|
||||
}
|
||||
}
|
||||
|
||||
//used by hal log
|
||||
const char * IRAM_ATTR pathToFileName(const char * path){
|
||||
size_t i = 0;
|
||||
size_t pos = 0;
|
||||
char * p = (char *)path;
|
||||
while(*p){
|
||||
i++;
|
||||
if(*p == '/' || *p == '\\'){
|
||||
pos = i;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return path+pos;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user