cc2500: drop exti, latency gain is minimal
#endif
-extern int liberror;
-
-static volatile uint8_t gdo0_exti_status = 1;
-
uint8_t cc2500_read_gdo0() {
- uint8_t val = gdo0_exti_status;
- gdo0_exti_status = 0;
- return val;
- //return GPIO_ReadInputDataBit(CC2500_GDO0_PORT, CC2500_GDO0_PIN);
+ return GPIO_ReadInputDataBit(CC2500_GDO0_PORT, CC2500_GDO0_PIN);
}
static void cc2500_hardware_init() {
@@ -85,27 +78,10 @@ static void cc2500_hardware_init() {
GPIO_InitStructure.GPIO_Pin = CC2500_GDO0_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
+ GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
+ GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_Init(CC2500_GDO0_PORT, &GPIO_InitStructure);
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
- SYSCFG_EXTILineConfig(CC2500_GDO0_EXTI_PINSOURCE, CC2500_GDO0_PINSOURCE);
-
- EXTI_InitTypeDef EXTI_InitStruct;
- EXTI_InitStruct.EXTI_Line = CC2500_GDO0_EXTI_LINE;
- EXTI_InitStruct.EXTI_LineCmd = ENABLE;
- EXTI_InitStruct.EXTI_Mode = EXTI_Mode_Interrupt;
- EXTI_InitStruct.EXTI_Trigger = EXTI_Trigger_Rising;
- EXTI_Init(&EXTI_InitStruct);
-
- NVIC_InitTypeDef NVIC_InitStruct;
- NVIC_InitStruct.NVIC_IRQChannel = EXTI15_10_IRQn;
- NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority = 0x0f;
- NVIC_InitStruct.NVIC_IRQChannelSubPriority = 0x0f;
- NVIC_InitStruct.NVIC_IRQChannelCmd = ENABLE;
- NVIC_Init(&NVIC_InitStruct);
-
spi_enable_rcc(CC2500_SPI_PORT);
SPI_I2S_DeInit(PORT.channel);
@@ -130,13 +106,6 @@ static void cc2500_hardware_init() {
spi_dma_init(CC2500_SPI_PORT);
}
-void CC2500_GDO0_EXTI_HANDLER() {
- if (EXTI_GetITStatus(CC2500_GDO0_EXTI_LINE) != RESET) {
- gdo0_exti_status = 1;
- }
- EXTI_ClearITPendingBit(CC2500_GDO0_EXTI_LINE);
-}
-
void cc2500_strobe(uint8_t address) {
spi_csn_enable(CC2500_NSS);
spi_transfer_byte(CC2500_SPI_PORT, address);
