]> git.tnoah.ca Git - lora-radio.git/commitdiff
minor changes
authorkaramo <karahoan@drei.at>
Thu, 13 Jan 2022 21:18:18 +0000 (22:18 +0100)
committerkaramo <karahoan@drei.at>
Thu, 13 Jan 2022 21:18:18 +0000 (22:18 +0100)
warning: comparison is always true due to limited range of data type
and add parentheses

RNode_Firmware.ino
Utilities.h

index 6c0301952e077de03f51ce12e5151e14a278f385..8d0386b7d5cd9da5b9c921793504952048cf463f 100644 (file)
@@ -422,7 +422,7 @@ void serialCallback(uint8_t sbyte) {
 
     if (!fifo16_isfull(&packet_starts) && queued_bytes < CONFIG_QUEUE_SIZE) {
         uint16_t s = current_packet_start;
-        uint16_t e = queue_cursor-1; if (e == -1) e = CONFIG_QUEUE_SIZE-1;
+        int e = queue_cursor-1; if (e == -1) e = CONFIG_QUEUE_SIZE-1;
         uint16_t l;
 
         if (s != e) {
@@ -631,9 +631,9 @@ void serialCallback(uint8_t sbyte) {
 void updateModemStatus() {
   uint8_t status = LoRa.modemStatus();
   last_status_update = millis();
-  if (status & SIG_DETECT == SIG_DETECT) { stat_signal_detected = true; } else { stat_signal_detected = false; }
-  if (status & SIG_SYNCED == SIG_SYNCED) { stat_signal_synced = true; } else { stat_signal_synced = false; }
-  if (status & RX_ONGOING == RX_ONGOING) { stat_rx_ongoing = true; } else { stat_rx_ongoing = false; }
+  if (status & (SIG_DETECT == SIG_DETECT)) { stat_signal_detected = true; } else { stat_signal_detected = false; }
+  if (status & (SIG_SYNCED == SIG_SYNCED)) { stat_signal_synced = true; } else { stat_signal_synced = false; }
+  if (status & (RX_ONGOING == RX_ONGOING)) { stat_rx_ongoing = true; } else { stat_rx_ongoing = false; }
 
   if (stat_signal_detected || stat_signal_synced || stat_rx_ongoing) {
     if (dcd_count < dcd_threshold) {
@@ -849,4 +849,4 @@ void serial_interrupt_init() {
   ISR(TIMER3_CAPT_vect) {
     buffer_serial();
   }
-#endif
\ No newline at end of file
+#endif
index fa45296775431df315e3fdc4598c4cb6d4e36e45..5be1ccf4d351d6a83de208255967386a219ed335 100644 (file)
@@ -512,9 +512,9 @@ void eeprom_update(int mapped_addr, uint8_t byte) {
 
 }
 
-void eeprom_write(uint8_t addr, uint8_t byte) {
-       if (!eeprom_info_locked() && addr >= 0 && addr < EEPROM_RESERVED) {
-               eeprom_update(eeprom_addr(addr), byte);
+void eeprom_write(int addr, uint8_t vbyte) {
+       if (!eeprom_info_locked() && (addr >= 0) && (addr < EEPROM_RESERVED)) {
+               eeprom_update(eeprom_addr(addr), vbyte);
        } else {
                kiss_indicate_error(ERROR_EEPROM_LOCKED);
        }