Skip to content
Snippets Groups Projects
Commit 3b5a0ef1 authored by Avon Gingell's avatar Avon Gingell
Browse files

Implemented callback

parent e9a5ebea
Branches callback
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
//for uart debugging //for uart debugging
#if RFM12_UART_DEBUG #if RFM12_UART_DEBUG
#include "../examples/uart_lib/uart.h" #include "../../uart.h"
#endif #endif
#if RFM12_USE_RX_CALLBACK #if RFM12_USE_RX_CALLBACK
...@@ -135,7 +135,7 @@ rfm12_control_t ctrl; ...@@ -135,7 +135,7 @@ rfm12_control_t ctrl;
#if (RFM12_USE_POLLING) #if (RFM12_USE_POLLING)
void rfm12_poll(void) void rfm12_poll(void)
#else #else
ISR(RFM12_INT_VECT, ISR_NOBLOCK) ISR(RFM12_INT_VECT)
#endif #endif
{ {
#ifdef USE_INT_PIN_CHECK #ifdef USE_INT_PIN_CHECK
...@@ -278,6 +278,13 @@ ISR(RFM12_INT_VECT, ISR_NOBLOCK) ...@@ -278,6 +278,13 @@ ISR(RFM12_INT_VECT, ISR_NOBLOCK)
UART_DEBUG_PUTC('D'); UART_DEBUG_PUTC('D');
rf_rx_buffers[ctrl.buffer_in_num].status = STATUS_OCCUPIED; rf_rx_buffers[ctrl.buffer_in_num].status = STATUS_OCCUPIED;
/* Call the callback function */
#if RFM12_USE_RX_CALLBACK
if (rfm12_rx_callback_func != 0x0000) {
rfm12_rx_callback_func(ctrl.rf_buffer_in->len,
ctrl.rf_buffer_in.buffer);
}
#endif
//switch to other buffer //switch to other buffer
ctrl.buffer_in_num ^= 1; ctrl.buffer_in_num ^= 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment