| 54 | // ============================================================================ |
| 55 | |
| 56 | const char *fastled_file_offset(const char *file) { |
| 57 | const char *p = file; |
| 58 | const char *last_slash = nullptr; |
| 59 | |
| 60 | while (*p) { |
| 61 | // Check for "src/" or "src\\" (handle both Unix and Windows paths) |
| 62 | if (p[0] == 's' && p[1] == 'r' && p[2] == 'c' && (p[3] == '/' || p[3] == '\\')) { |
| 63 | return p; // Skip past "src/" or "src\\" |
| 64 | } |
| 65 | // Track both forward slash and backslash |
| 66 | if (*p == '/' || *p == '\\') { |
| 67 | last_slash = p; |
| 68 | } |
| 69 | p++; |
| 70 | } |
| 71 | // If "src/" or "src\\" not found but we found at least one slash, return after the |
| 72 | // last slash |
| 73 | if (last_slash) { |
| 74 | return last_slash + 1; |
| 75 | } |
| 76 | return file; // If no slashes found at all, return original path |
| 77 | } |
| 78 | |
| 79 | // NOTE: AsyncLogger implementation moved to fl/log/async_logger.cpp |
| 80 | // Background flush infrastructure and async_log_service also moved there |