diff --git a/conf/airframes/TUDELFT/tudelft_outback.xml b/conf/airframes/TUDELFT/tudelft_outback.xml index 7e055fa418..f06e3cbe35 100644 --- a/conf/airframes/TUDELFT/tudelft_outback.xml +++ b/conf/airframes/TUDELFT/tudelft_outback.xml @@ -35,9 +35,7 @@ - - - + diff --git a/conf/modules/logger_sd_spi_direct.xml b/conf/modules/logger_sd_spi_direct.xml index 44bf65c18b..3c06d54956 100644 --- a/conf/modules/logger_sd_spi_direct.xml +++ b/conf/modules/logger_sd_spi_direct.xml @@ -27,6 +27,7 @@ Do not use start/stop functionality of the module, the module is not intended to + @@ -40,7 +41,6 @@ Do not use start/stop functionality of the module, the module is not intended to - @@ -55,7 +55,6 @@ Do not use start/stop functionality of the module, the module is not intended to - diff --git a/sw/airborne/modules/loggers/sdlogger_spi_direct.c b/sw/airborne/modules/loggers/sdlogger_spi_direct.c index 9630a7c821..97e00d90d7 100644 --- a/sw/airborne/modules/loggers/sdlogger_spi_direct.c +++ b/sw/airborne/modules/loggers/sdlogger_spi_direct.c @@ -32,7 +32,6 @@ #include "modules/loggers/sdlogger_spi_direct.h" #include "subsystems/datalink/downlink.h" #include "subsystems/datalink/telemetry.h" -#include "subsystems/radio_control.h" #include "led.h" #ifdef LOGGER_LED @@ -86,6 +85,7 @@ void sdlogger_spi_direct_init(void) sdlogger_spi.download_id = 0; sdlogger_spi.download_address = 0; sdlogger_spi.download_length = 0; + sdlogger_spi.do_log = 0; /* Set function pointers in link_device to the logger functions */ sdlogger_spi.device.check_free_space = (check_free_space_t)sdlogger_spi_direct_check_free_space; @@ -115,7 +115,7 @@ void sdlogger_spi_direct_periodic(void) break; case SDLogger_Ready: - if (radio_control.values[SDLOGGER_CONTROL_SWITCH] > 0 && + if ((sdlogger_spi.do_log == 1) && sdcard1.status == SDCard_Idle) { LOGGER_LED_ON; sdcard_spi_multiwrite_start(&sdcard1, sdlogger_spi.next_available_address); @@ -136,7 +136,7 @@ void sdlogger_spi_direct_periodic(void) sdcard_spi_multiwrite_next(&sdcard1, &sdlogger_spi_direct_multiwrite_written); } /* Check if switch is flipped to stop logging */ - if (radio_control.values[SDLOGGER_CONTROL_SWITCH] < 0) { + if (sdlogger_spi.do_log == 0) { sdlogger_spi.status = SDLogger_LoggingFinalBlock; } break; @@ -223,13 +223,16 @@ void sdlogger_spi_direct_index_received(void) case SDLogger_RetreivingIndex: sdlogger_spi.next_available_address = 0x00004000; sdlogger_spi.last_completed = 0; - /* Save data for later use + // Save data for later use sdlogger_spi.next_available_address = (sdcard1.input_buf[0] << 24) | (sdcard1.input_buf[1] << 16) | (sdcard1.input_buf[2] << 8) | (sdcard1.input_buf[3]); sdlogger_spi.last_completed = sdcard1.input_buf[4]; - */ + + if(sdlogger_spi.next_available_address < 0x00004000) { + sdlogger_spi.next_available_address = 0x00004000; + } /* Ready to start logging */ sdlogger_spi.status = SDLogger_Ready; diff --git a/sw/airborne/modules/loggers/sdlogger_spi_direct.h b/sw/airborne/modules/loggers/sdlogger_spi_direct.h index 1d5c208155..2ef31166af 100644 --- a/sw/airborne/modules/loggers/sdlogger_spi_direct.h +++ b/sw/airborne/modules/loggers/sdlogger_spi_direct.h @@ -59,6 +59,7 @@ struct sdlogger_spi_periph{ uint32_t download_address; uint32_t download_length; struct link_device device; + uint8_t do_log; }; extern struct sdlogger_spi_periph sdlogger_spi;