/** * @brief execute asynchronous event, based on type */ static void async_event_execute(async_event_t* p_evt) { switch (p_evt->type) { case EVENT_TYPE_TIMER: CHECK_FP(p_evt->callback.timer.cb); (*p_evt->callback.timer.cb)(p_evt->callback.timer.timestamp); break; case EVENT_TYPE_GENERIC: CHECK_FP(p_evt->callback.generic.cb); (*p_evt->callback.generic.cb)(p_evt->callback.generic.p_context); break; case EVENT_TYPE_PACKET: tc_packet_handler(p_evt->callback.packet.payload, p_evt->callback.packet.crc, p_evt->callback.packet.timestamp, p_evt->callback.packet.rssi); case EVENT_TYPE_SET_FLAG: handle_storage_flag_set(p_evt->callback.set_flag.handle, (handle_flag_t) p_evt->callback.set_flag.flag, p_evt->callback.set_flag.value); default: break; } }
/** * @brief execute asynchronous event, based on type */ static void async_event_execute(async_event_t* p_evt) { switch (p_evt->type) { case EVENT_TYPE_TIMER: CHECK_FP(p_evt->callback.timer.cb); p_evt->callback.timer.cb(p_evt->callback.timer.timestamp); #if defined(WITH_ACK_MASTER) || defined (WITHOUT_ACK_MASTER)||defined(WITH_ACK_SLAVE)||defined(WITHOUT_ACK_SLAVE) event_handler_counter[0]++; #endif break; case EVENT_TYPE_GENERIC: CHECK_FP(p_evt->callback.generic.cb); p_evt->callback.generic.cb(p_evt->callback.generic.p_context); #if defined(WITH_ACK_MASTER) || defined (WITHOUT_ACK_MASTER)||defined(WITH_ACK_SLAVE)||defined(WITHOUT_ACK_SLAVE) event_handler_counter[1]++; #endif break; case EVENT_TYPE_PACKET: tc_packet_handler(p_evt->callback.packet.payload, p_evt->callback.packet.crc, p_evt->callback.packet.timestamp, p_evt->callback.packet.rssi); #if defined(WITH_ACK_MASTER) || defined (WITHOUT_ACK_MASTER)||defined(WITH_ACK_SLAVE)||defined(WITHOUT_ACK_SLAVE) event_handler_counter[2]++; #endif break; case EVENT_TYPE_SET_FLAG: handle_storage_flag_set(p_evt->callback.set_flag.handle, (handle_flag_t) p_evt->callback.set_flag.flag, p_evt->callback.set_flag.value); #if defined(WITH_ACK_MASTER) || defined (WITHOUT_ACK_MASTER)||defined(WITH_ACK_SLAVE)||defined(WITHOUT_ACK_SLAVE) event_handler_counter[3]++; #endif break; case EVENT_TYPE_TIMER_SCH: CHECK_FP(p_evt->callback.timer_sch.cb); p_evt->callback.timer_sch.cb(p_evt->callback.timer_sch.timestamp, p_evt->callback.timer_sch.p_context); #if defined(WITH_ACK_MASTER) || defined (WITHOUT_ACK_MASTER)||defined(WITH_ACK_SLAVE)||defined(WITHOUT_ACK_SLAVE) event_handler_counter[4]++; #endif break; default: break; } }