FastLED 3.9.15
Loading...
Searching...
No Matches

◆ fastled_file_offset()

const char * fl::fastled_file_offset ( const char * file)
inline

Definition at line 20 of file dbg.h.

20 {
21 const char *p = file;
22 const char *last_slash = nullptr;
23
24 while (*p) {
25 if (p[0] == 's' && p[1] == 'r' && p[2] == 'c' && p[3] == '/') {
26 return p; // Skip past "src/"
27 }
28 if (*p == '/') { // fallback to using last slash
29 last_slash = p;
30 }
31 p++;
32 }
33 // If "src/" not found but we found at least one slash, return after the
34 // last slash
35 if (last_slash) {
36 return last_slash + 1;
37 }
38 return file; // If no slashes found at all, return original path
39}