From 36f20a8ca3d77fd99c45623b51fca0cdeb5a4f48 Mon Sep 17 00:00:00 2001 From: questor/Inter Date: Sat, 27 May 2023 22:04:56 +0200 Subject: [PATCH] some more comments --- CMakeLists.txt | 6 ++++-- shared.h | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06d035a..8f08180 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,9 +43,11 @@ target_link_libraries( pico_multicore ) -# enable usb output, disable uart output +# disable usb stack pico_enable_stdio_usb(RP2040-Decoder 0) -pico_enable_stdio_uart(RP2040-Decoder 1) + +# disable uart output (to enable put a 1 instead of the 0) +pico_enable_stdio_uart(RP2040-Decoder 0) # create map/bin/hex file etc. #pico_add_extra_outputs(RP2040-Decoder) diff --git a/shared.h b/shared.h index 68fd3ac..dca4270 100644 --- a/shared.h +++ b/shared.h @@ -23,8 +23,8 @@ // like already done (only print every 100th iteration for example!) // - also note that with logging enabled GPIO0/1 are DISABLED from decoder functions because they are used for uart to the // outside world (this is configure automatically for you below!) +// - IMPORTANT: you have to enable uart in the cmakelists.txt to enable logging! #define LOGLEVEL 0 -//#define LOG(level, x, ...) {if(level <= LOGLEVEL) { printf((x), ##__VA_ARGS__);}} #define LOG(level, ...) { if(level <= LOGLEVEL) {printf(__VA_ARGS__);}} // Constant Value of 125 x 10⁶ @@ -37,8 +37,9 @@ #define FWD_V_EMF_ADC_PIN 28u #define REV_V_EMF_ADC_PIN 29u +// if logging is enabled do NOT use gpio0/1 for functions in the decoder #if LOGLEVEL != 0 - // GPIO used directly (GPIO 0-5 incl.) as outputs or to switch auxiliary output transistors (GPIO 24-27 incl.) + // GPIO used directly (GPIO 2-5 incl.) as outputs or to switch auxiliary output transistors (GPIO 24-27 incl.) #define GPIO_OUTPUT_PIN_MASK (1u<<24) | (1u<<25) | (1u<<26) | (1u<<27) | (1u<<5) | (1u<<4) | (1u<<3) | (1u<<2) #else // GPIO used directly (GPIO 0-5 incl.) as outputs or to switch auxiliary output transistors (GPIO 24-27 incl.) @@ -64,4 +65,4 @@ float measure(uint8_t total_iterations, uint8_t r_side_arr_cutoff, bool direction); uint32_t get_32bit_CV (uint16_t CV_start_index); -uint16_t get_16bit_CV (uint16_t CV_start_index); \ No newline at end of file +uint16_t get_16bit_CV (uint16_t CV_start_index);