From 40620f17365159be4aefb3cde7977a432dcdb81e Mon Sep 17 00:00:00 2001 From: Antoine Drouin Date: Thu, 12 Aug 2010 18:47:03 +0000 Subject: [PATCH] removed the first generation crc error handling --- .../lisa/arch/stm32/lisa_overo_link_arch.h | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/sw/airborne/lisa/arch/stm32/lisa_overo_link_arch.h b/sw/airborne/lisa/arch/stm32/lisa_overo_link_arch.h index 8fb3aec77b..ca8ee5b862 100644 --- a/sw/airborne/lisa/arch/stm32/lisa_overo_link_arch.h +++ b/sw/airborne/lisa/arch/stm32/lisa_overo_link_arch.h @@ -4,14 +4,6 @@ #include -#if 1 - -/* - * - * This is the version that got less tested - * - */ - #define OveroLinkEvent(_data_received_handler, _crc_failed_handler) { \ if (overo_link.status == DATA_AVAILABLE) { /* set by DMA interrupt */ \ while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE)==RESET); \ @@ -47,45 +39,6 @@ } -#else - -/* - * - * This is the version that works - * - */ - -#define OveroLinkEvent(_data_received_handler, _crc_failed_handler) { \ - if (overo_link.status == DATA_AVAILABLE) { \ - overo_link.timeout = 0; \ - /* FIXME : we should probably add a limit here and do something */ \ - /* radical in case we exceed it */ \ - while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE)==RESET); \ - while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_BSY)==SET); \ - uint8_t foo __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI1); \ - if((SPI_I2S_GetFlagStatus(SPI1, SPI_FLAG_CRCERR)) == RESET) { \ - LED_TOGGLE(OVERO_LINK_LED_OK); \ - LED_OFF(OVERO_LINK_LED_KO); \ - _data_received_handler(); \ - } \ - else { \ - LED_OFF(OVERO_LINK_LED_OK); \ - LED_ON(OVERO_LINK_LED_KO); \ - overo_link.crc_err_cnt++; \ - _crc_failed_handler(); \ - /* wait until we're not selected - same thing, we would */ \ - /* probably want a limit here */ \ - while (!GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_4)); \ - uint8_t foo2 __attribute__ ((unused)) = SPI_I2S_ReceiveData(SPI1); \ - violently_reset_spi(); \ - } \ - overo_link.msg_cnt++; \ - overo_link_arch_prepare_next_transfert(); \ - overo_link.status = IDLE; \ - } \ - } -#endif - #define violently_reset_spi() { \ SPI_Cmd(SPI1, DISABLE); \