diff --git a/CMakeLists.txt b/CMakeLists.txt index bc3a9d9..c4eb086 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,11 @@ add_executable( core1.h shared.h) +# Multiplier to lengthen XOSC startup delay to accommodate slow-starting oscillator +target_compile_definitions( + RP2040-Decoder PUBLIC + PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64 +) # Add pico_multicore which is required for multicore functionality target_link_libraries( diff --git a/core0.c b/core0.c index 2e02ce5..04d860e 100644 --- a/core0.c +++ b/core0.c @@ -288,21 +288,15 @@ void evaluation(){ } int main() { - //busy_wait_ms(2000); stdio_init_all(); printf("core0 init...\n"); - //gpio_init(PICO_DEFAULT_LED_PIN); - //gpio_set_dir(PICO_DEFAULT_LED_PIN,GPIO_OUT); - //gpio_put(PICO_DEFAULT_LED_PIN,true); - gpio_init(DCC_INPUT_PIN); - gpio_set_dir(DCC_INPUT_PIN, GPIO_IN); //gpio_init_mask(ALLOWED_GPIO_MASK); //gpio_set_dir_out_masked(ALLOWED_GPIO_MASK); multicore_launch_core1(core1_entry); + gpio_init(DCC_INPUT_PIN); + gpio_set_dir(DCC_INPUT_PIN, GPIO_IN); gpio_set_irq_enabled_with_callback(DCC_INPUT_PIN, GPIO_IRQ_EDGE_RISE, true, &gpio_callback_rise); printf("core0 done\n"); while (1){ - printf("0\n"); - printf("0-\n"); } } \ No newline at end of file diff --git a/core1.c b/core1.c index cc7fd66..0ed02ae 100644 --- a/core1.c +++ b/core1.c @@ -221,8 +221,5 @@ void core1_entry() { NULL, &speed_helper_timer); printf("core1 done\n"); - while (1){ - printf("1\n"); - printf("-1\n"); - } + while (1); } \ No newline at end of file