问题1 驱动LCD 导致射频无法发送数据
LCD_SEG14 对应 stm8 的 SEG18 PD4
LCD_SEG15 对应 stm8 的 SEG18 PD5
ASR6505 ---> stm8L
NSS ---> PD7
虽然LCD_SEG14 和 LCD_SEG15 未使用,调试时全部初始化了
初始化 LCD时
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x3F); //SEG16-21
导致影响了 NSS 脚使用,从而数据无法发送
修改为
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0x03); //SEG16-21
解决
问题2:
官方IO中断中 将 RtcRecoverMcuStatus( ); 写在
void HAL_GPIO_EXTI_IRQHandler(EXTI_IT_TypeDef EXTI_IT)
{
#if !defined( USE_NO_TIMER )
RtcRecoverMcuStatus( );
#endif
if (EXTI_GetITStatus(EXTI_IT) != RESET)
{
// printf("14-%d\r\n", EXTI_IT);
//clear the it status first, otherwise when do call RadioIrqProcess when it enableinterrupts() it will re-enter into the interrupt handler
EXTI_ClearITPendingBit(EXTI_IT);
HAL_GPIO_EXTI_Callback(EXTI_IT);
}
}
中断中
stm8 IO中断存在一个问题,循环进入中断,即使及时清除中断仍会进入
导致 SPI多次初始化,但是又初始化失败
解决办法:将mcu唤醒提取到中断中
void HAL_GPIO4_EXTI_IRQHandler(EXTI_IT_TypeDef EXTI_IT)
{
if (EXTI_GetITStatus(EXTI_IT) != RESET)
{
// printf("14-%d\r\n", EXTI_IT);
//clear the it status first, otherwise when do call RadioIrqProcess when it enableinterrupts() it will re-enter into the interrupt handler
EXTI_ClearITPendingBit(EXTI_IT);
HAL_GPIO_EXTI_Callback(EXTI_IT);
}
}
中断回调:
void GPIO4_exit()
{
#if !defined( USE_NO_TIMER )
RtcRecoverMcuStatus( );
#endif
printf("GPIO4_exit\r\n");
btn_wakeUp();
GpioRemoveInterrupt(&Gpio4);
}