diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bc0982..e9ae3dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,11 @@ cmake_minimum_required(VERSION 3.13) +cmake_policy(SET CMP0135 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) + +set(PICO_SDK_FETCH_FROM_GIT on) +set(PICOTOOL_FETCH_FROM_GIT_PATH build/picotool) + set(PROGRAM_NAME pico_bmc) set(PICO_BOARD pico_w) include(pico_sdk_import.cmake) diff --git a/http_parser.h b/http_parser.h index 2b6986c..2416550 100644 --- a/http_parser.h +++ b/http_parser.h @@ -81,7 +81,7 @@ void delete_request_parser (HTTP_REQUEST_PARSER_T * wrapper) { typedef struct HTTP_RESPONSE_DATA_T_ { llhttp_status_t status; - char type[32]; + char type[128]; char body[128]; } HTTP_RESPONSE_DATA_T; diff --git a/pico_sdk_import.cmake b/pico_sdk_import.cmake index 65f8a6f..a0721d0 100644 --- a/pico_sdk_import.cmake +++ b/pico_sdk_import.cmake @@ -18,9 +18,20 @@ if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_P message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") endif () +if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) + set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) + message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") +endif () + +if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) + set(PICO_SDK_FETCH_FROM_GIT_TAG "master") + message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") +endif() + set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") +set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") if (NOT PICO_SDK_PATH) if (PICO_SDK_FETCH_FROM_GIT) @@ -34,14 +45,14 @@ if (NOT PICO_SDK_PATH) FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} GIT_SUBMODULES_RECURSE FALSE ) else () FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} ) endif () diff --git a/serial_handler.h b/serial_handler.h index c342012..9e1547e 100644 --- a/serial_handler.h +++ b/serial_handler.h @@ -68,7 +68,9 @@ void key_pressed_worker_func(async_context_t * context, async_when_pending_worke append_char(key); } else if (key == 27) { // escape & escape codes - while (getchar_timeout_us(0) > 0) {} + while (getchar_timeout_us(0) > 0) { + // TODO handle escape codes + } break; } else { // other unhandled key @@ -83,7 +85,7 @@ static async_when_pending_worker_t key_pressed_worker = { // because of stdio_set_chars_available_callback implementation, stdlib mutex is locked here so schedule another callback void key_pressed_func(void * param) { - async_context_set_work_pending((async_context_t *)param, &key_pressed_worker); + async_context_set_work_pending((async_context_t *) param, &key_pressed_worker); } // init serial handler diff --git a/template.secret.h b/template.secret.h index 4548bb3..a15cf9b 100644 --- a/template.secret.h +++ b/template.secret.h @@ -1,8 +1,8 @@ #ifndef SECRET_H #define SECRET_H -const char BMC_HOSTNAME [] = "pico_bmc"; -const char WIFI_SSID [] = "ssid"; -const char WIFI_PASS [] = "pass"; +const char BMC_HOSTNAME [64] = "pico_bmc"; +const char WIFI_SSID [64] = "ssid"; +const char WIFI_PASS [64] = "pass"; #endif \ No newline at end of file