sforkowany z mirror/meshtastic-firmware
better debug output
rodzic
5af122b39d
commit
0096f54ae9
|
@ -5,7 +5,7 @@
|
|||
Minimum items needed to make sure hardware is good.
|
||||
|
||||
- add a hard fault handler
|
||||
- at boot we are starting our message IDs at 1, rather we should start them at a random number. also, seed random based on timer. this could be the cause of our first message not seen bug. keep packet sequence number in **attribute** ((section (".noinit")))
|
||||
- at boot we are starting our message IDs at 1, rather we should start them at a random number. also, seed random based on timer. this could be the cause of our first message not seen bug.
|
||||
- use "variants" to get all gpio bindings
|
||||
- plug in correct variants for the real board
|
||||
- Use the PMU driver on real hardware
|
||||
|
|
|
@ -61,7 +61,8 @@ static Periodic sendOwnerPeriod(sendOwnerCb);
|
|||
// FIXME, move this someplace better
|
||||
PacketId generatePacketId()
|
||||
{
|
||||
static uint32_t i;
|
||||
static uint32_t i __attribute__((
|
||||
section(".noinit"))); // We try to keep this in noinit so that hopefully it keeps increasing even across reboots
|
||||
|
||||
i++;
|
||||
return (i % NUM_PACKET_ID) + 1; // return number between 1 and 255
|
||||
|
|
|
@ -89,8 +89,8 @@ void RF95Interface::setStandby()
|
|||
assert(err == ERR_NONE);
|
||||
|
||||
isReceiving = false; // If we were receiving, not any more
|
||||
completeSending(); // If we were sending, not anymore
|
||||
disableInterrupt();
|
||||
completeSending(); // If we were sending, not anymore
|
||||
}
|
||||
|
||||
void RF95Interface::startReceive()
|
||||
|
|
|
@ -101,8 +101,8 @@ bool RadioLibInterface::canSleep()
|
|||
|
||||
void RadioLibInterface::loop()
|
||||
{
|
||||
PendingISR wasPending = pending; // atomic read
|
||||
if (wasPending) {
|
||||
PendingISR wasPending;
|
||||
while ((wasPending = pending) != 0) { // atomic read
|
||||
pending = ISR_NONE; // If the flag was set, it is _guaranteed_ the ISR won't be running, because it masked itself
|
||||
|
||||
if (wasPending == ISR_TX)
|
||||
|
@ -130,8 +130,8 @@ void RadioLibInterface::startNextWork()
|
|||
|
||||
void RadioLibInterface::handleTransmitInterrupt()
|
||||
{
|
||||
DEBUG_MSG("handling lora TX interrupt\n");
|
||||
assert(sendingPacket); // Were we sending?
|
||||
// DEBUG_MSG("handling lora TX interrupt\n");
|
||||
assert(sendingPacket); // Were we sending? - FIXME, this was null coming out of light sleep due to RF95 ISR!
|
||||
|
||||
completeSending();
|
||||
}
|
||||
|
@ -140,6 +140,7 @@ void RadioLibInterface::completeSending()
|
|||
{
|
||||
if (sendingPacket) {
|
||||
txGood++;
|
||||
DEBUG_MSG("Completed sending to=0x%x, id=%u\n", sendingPacket->to, sendingPacket->id);
|
||||
|
||||
// We are done sending that packet, release it
|
||||
packetPool.release(sendingPacket);
|
||||
|
@ -153,8 +154,6 @@ void RadioLibInterface::handleReceiveInterrupt()
|
|||
assert(isReceiving);
|
||||
isReceiving = false;
|
||||
|
||||
DEBUG_MSG("handling lora RX interrupt\n");
|
||||
|
||||
// read the number of actually received bytes
|
||||
size_t length = iface->getPacketLength();
|
||||
|
||||
|
@ -195,6 +194,7 @@ void RadioLibInterface::handleReceiveInterrupt()
|
|||
// parsing was successful, queue for our recipient
|
||||
mp->has_payload = true;
|
||||
rxGood++;
|
||||
DEBUG_MSG("Lora RX interrupt from=0x%x, id=%u\n", mp->from, mp->id);
|
||||
|
||||
deliverToReceiver(mp);
|
||||
}
|
||||
|
|
|
@ -75,14 +75,15 @@ void SX1262Interface::setStandby()
|
|||
assert(err == ERR_NONE);
|
||||
|
||||
isReceiving = false; // If we were receiving, not any more
|
||||
completeSending(); // If we were sending, not anymore
|
||||
disableInterrupt();
|
||||
completeSending(); // If we were sending, not anymore
|
||||
}
|
||||
|
||||
/**
|
||||
* Add SNR data to received messages
|
||||
*/
|
||||
void SX1262Interface::addReceiveMetadata(MeshPacket *mp) {
|
||||
void SX1262Interface::addReceiveMetadata(MeshPacket *mp)
|
||||
{
|
||||
mp->rx_snr = lora.getSNR();
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue