File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 76
76
#define PRINTF (...) do {} while (0)
77
77
#endif
78
78
79
- #define RX_ACTIVE 0x80
80
- #define TX_ACK 0x40
81
- #define TX_ON_AIR 0x20
82
- #define WAS_OFF 0x10
79
+ /* rf_flags bits */
80
+ #define RX_ACTIVE 0x80
81
+ #define TX_ACK 0x40
82
+ #define TX_ON_AIR 0x20
83
+ #define WAS_OFF 0x10
84
+ #define INITIALISED 0x01
85
+
83
86
#define RX_NO_DMA
84
87
/* Bits of the last byte in the RX FIFO */
85
88
#define CRC_BIT_MASK 0x80
@@ -102,7 +105,6 @@ uint8_t rf_error = 0;
102
105
PROCESS (cc2430_rf_process , "CC2430 RF driver" );
103
106
#endif
104
107
/*---------------------------------------------------------------------------*/
105
- static uint8_t rf_initialized = 0 ;
106
108
static uint8_t __data rf_flags ;
107
109
static uint8_t rf_channel ;
108
110
@@ -308,7 +310,7 @@ cc2430_rf_send_ack(uint8_t pending)
308
310
static int
309
311
init (void )
310
312
{
311
- if (rf_initialized ) {
313
+ if (rf_flags & INITIALISED ) {
312
314
return 0 ;
313
315
}
314
316
@@ -358,7 +360,8 @@ init(void)
358
360
359
361
RF_TX_LED_OFF ();
360
362
RF_RX_LED_OFF ();
361
- rf_initialized = 1 ;
363
+
364
+ rf_flags |= INITIALISED ;
362
365
363
366
#if !NETSTACK_CONF_SHORTCUTS
364
367
process_start (& cc2430_rf_process , NULL );
Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ off(void)
475
475
CC2530_CSP_ISRFOFF ();
476
476
CC2530_CSP_ISFLUSHRX ();
477
477
478
- rf_flags = 0 ;
478
+ rf_flags &= ~ RX_ACTIVE ;
479
479
480
480
ENERGEST_OFF (ENERGEST_TYPE_LISTEN );
481
481
return 1 ;
You can’t perform that action at this time.
0 commit comments