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:
me-no-dev
2016-11-13 13:40:31 +02:00
parent a5d52ac4f7
commit bfe6e5ae77
4 changed files with 58 additions and 7 deletions

View File

@ -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;
}