12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include "main.h"
- static uint32_t err_b = 0;
- /********************** Íⲿº¯ÊýÉùÃ÷Çø *************************/
- uint32_t ERR_Get(void)
- {
- return err_b;
- }
- void ERR_process(void)
- {
- uint32_t ret = IMU_GetError();
- if(ret!=err_b){ err_b = ret;
- LED_AllOff();
- }
- static uint32_t tim=0;
- if(TIME_GetTicks()-tim>=1000){ tim = TIME_GetTicks();
- if(err_b&ERR_IMU_MASK_9DOT){
- #if DEBUG_ERROR
- DEBUG_LOG("ERROR(%08X):ERR_IMU_MASK_9DOT\n",err_b);
- #endif
- nrf_gpio_pin_toggle(LED_R);
- }
- if(err_b&ERR_IMU_MASK_PRESS){
- #if DEBUG_ERROR
- DEBUG_LOG("ERROR(%08X):ERR_IMU_MASK_PRESS\n",err_b);
- #endif
- nrf_gpio_pin_toggle(LED_G);
- }
- if(err_b&ERR_IMU_MASK_SLAVE){
- #if DEBUG_ERROR
- DEBUG_LOG("ERROR(%08X):ERR_IMU_MASK_SLAVE\n",err_b);
- #endif
- nrf_gpio_pin_toggle(LED_B);
- }
- }
- }
- void ERR_Init(void)
- {
- Process_Regist(ERR_process);
- }
|