diff --git a/src/dev/posix/hasp_posix.cpp b/src/dev/posix/hasp_posix.cpp index a70ff4e2..af392e62 100644 --- a/src/dev/posix/hasp_posix.cpp +++ b/src/dev/posix/hasp_posix.cpp @@ -62,11 +62,11 @@ void PosixDevice::show_info() if(uname(&uts) < 0) { LOG_ERROR(0, "uname() error"); } else { - LOG_VERBOSE(0, "Sysname: %s", uts.sysname); - LOG_VERBOSE(0, "Nodename: %s", uts.nodename); - LOG_VERBOSE(0, "Release: %s", uts.release); - LOG_VERBOSE(0, "Version: %s", uts.version); - LOG_VERBOSE(0, "Machine: %s", uts.machine); + LOG_VERBOSE(0, "Sysname : %s", uts.sysname); + LOG_VERBOSE(0, "Nodename : %s", uts.nodename); + LOG_VERBOSE(0, "Release : %s", uts.release); + LOG_VERBOSE(0, "Version : %s", uts.version); + LOG_VERBOSE(0, "Machine : %s", uts.machine); } LOG_VERBOSE(0, "Processor : %s", "unknown"); diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index db7ffdf4..1124a76d 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -800,7 +800,11 @@ void dispatch_run_script(const char*, const char* payload, uint8_t source) path[0] = '.'; path[1] = '\0'; strcat(path, filename); +#if defined(WINDOWS) path[1] = '\\'; +#elif defined(POSIX) + path[1] = '/'; +#endif LOG_TRACE(TAG_HASP, F("Loading %s from disk..."), path); std::ifstream f(path); // taking file as inputstream @@ -1323,8 +1327,8 @@ void dispatch_current_state(uint8_t source) bool dispatch_factory_reset() { bool formatted = true; - bool erased = true; - bool cleared = true; + bool erased = true; + bool cleared = true; #if ESP32 erased = nvs_clear_user_config(); diff --git a/src/hasp/hasp_page.cpp b/src/hasp/hasp_page.cpp index bb970e57..50b80343 100644 --- a/src/hasp/hasp_page.cpp +++ b/src/hasp/hasp_page.cpp @@ -244,7 +244,11 @@ void Page::load_jsonl(const char* pagesfile) path[0] = '.'; path[1] = '\0'; strcat(path, pagesfile); +#if defined(WINDOWS) path[1] = '\\'; +#elif defined(POSIX) + path[1] = '/'; +#endif LOG_TRACE(TAG_HASP, F("Loading %s from disk..."), path); std::ifstream f(path); // taking file as inputstream diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 421606cc..2adfd826 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -29,6 +29,7 @@ #if defined(POSIX) #include +#include #define cwd getcwd #endif diff --git a/src/main_pc.cpp b/src/main_pc.cpp index cb6f7c03..50690677 100644 --- a/src/main_pc.cpp +++ b/src/main_pc.cpp @@ -17,6 +17,7 @@ #if defined(POSIX) #include #include +#include #define cwd getcwd #define cd chdir #endif @@ -104,17 +105,20 @@ void InitializeConsoleOutput() void usage(const char* progName, const char* version) { - std::cout - << "\n" - << progName << " " << version << " [options]" << std::endl - << std::endl - << "Options:" << std::endl - << " -h | --help Print this help" << std::endl - << " -W | --width Width of the window" << std::endl - << " -H | --height Height of the window" << std::endl - << " -C | --config Configuration directory (default: '~/.local/share/hasp' or 'AppData\\hasp\\hasp')" - << std::endl - << std::endl; + std::cout << "\n" + << progName << " " << version << " [options]" << std::endl + << std::endl + << "Options:" << std::endl + << " -h | --help Print this help" << std::endl + << " -W | --width Width of the window" << std::endl + << " -H | --height Height of the window" << std::endl + << " -C | --config Configuration directory" << std::endl +#if defined(WINDOWS) + << " (default: 'AppData\\hasp\\hasp')" << std::endl +#elif defined(POSIX) + << " (default: '~/.local/share/hasp/hasp')" << std::endl +#endif + << std::endl; fflush(stdout); }