bool memory_low = false;
uint8_t implicit_l = 0;
- volatile bool packet_ready = false;
- volatile uint8_t packet_interface = 0xFF;
+ uint8_t packet_interface = 0xFF;
uint8_t op_mode = MODE_HOST;
uint8_t model = 0x00;
size_t len;
int rssi;
int snr_raw;
- uint8_t data[];
uint8_t interface;
+ uint8_t data[];
} modem_packet_t;
static xQueueHandle modem_packet_queue = NULL;
#endif
}
-inline bool queuePacket(RadioInterface* radio, uint8_t index) {
+inline bool queue_packet(RadioInterface* radio, uint8_t index) {
// Allocate packet struct, but abort if there
// is not enough memory available.
modem_packet_t *modem_packet = (modem_packet_t*)malloc(sizeof(modem_packet_t) + read_len);
memcpy(modem_packet->data, pbuf, read_len);
if (!modem_packet_queue || xQueueSendFromISR(modem_packet_queue, &modem_packet, NULL) != pdPASS) {
free(modem_packet);
+ return false;
}
+ return true;
}
void ISR_VECT receive_callback(uint8_t index, int packet_size) {
}
if (ready) {
- queuePacket(selected_radio, index);
+ queue_packet(selected_radio, index);
}
last_rx = millis();
setTimeout(0);
// TODO, figure out why this has to be done. Using the index to reference the
// interface_obj list causes a crash otherwise
- _index = getIndex();
+ //_index = getIndex();
}
bool sx126x::preInit() {
setTimeout(0);
// TODO, figure out why this has to be done. Using the index to reference the
// interface_obj list causes a crash otherwise
- _index = getIndex();
+ //_index = getIndex();
}
void sx127x::setSPIFrequency(uint32_t frequency) { _spiSettings = SPISettings(frequency, MSBFIRST, SPI_MODE0); }
setTimeout(0);
// TODO, figure out why this has to be done. Using the index to reference the
// interface_obj list causes a crash otherwise
- _index = getIndex();
+ //_index = getIndex();
}
bool sx128x::preInit() {