remove warnings
"unused variable" "uninitialized"
This commit is contained in:
parent
72a4678949
commit
291868af6d
@ -363,7 +363,7 @@ void transmit(uint16_t size) {
|
|||||||
LoRa.beginPacket();
|
LoRa.beginPacket();
|
||||||
LoRa.write(header); written++;
|
LoRa.write(header); written++;
|
||||||
|
|
||||||
for (uint16_t i; i < size; i++) {
|
for (int i=0; i < size; i++) {
|
||||||
LoRa.write(tbuf[i]);
|
LoRa.write(tbuf[i]);
|
||||||
|
|
||||||
written++;
|
written++;
|
||||||
@ -400,7 +400,7 @@ void transmit(uint16_t size) {
|
|||||||
LoRa.beginPacket(size);
|
LoRa.beginPacket(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint16_t i; i < size; i++) {
|
for (int i=0; i < size; i++) {
|
||||||
LoRa.write(tbuf[i]);
|
LoRa.write(tbuf[i]);
|
||||||
|
|
||||||
written++;
|
written++;
|
||||||
@ -805,7 +805,7 @@ void buffer_serial() {
|
|||||||
// Discard GPS data for now
|
// Discard GPS data for now
|
||||||
c = 0;
|
c = 0;
|
||||||
while (c < MAX_CYCLES && Serial1.available()) {
|
while (c < MAX_CYCLES && Serial1.available()) {
|
||||||
uint8_t void_c = Serial1.read();
|
Serial1.read();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
36
Utilities.h
36
Utilities.h
@ -210,10 +210,10 @@ int8_t led_standby_direction = 0;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void escapedSerialWrite(uint8_t byte) {
|
void escapedSerialWrite(uint8_t vbyte) {
|
||||||
if (byte == FEND) { Serial.write(FESC); byte = TFEND; }
|
if (vbyte == FEND) { Serial.write(FESC); vbyte = TFEND; }
|
||||||
if (byte == FESC) { Serial.write(FESC); byte = TFESC; }
|
if (vbyte == FESC) { Serial.write(FESC); vbyte = TFESC; }
|
||||||
Serial.write(byte);
|
Serial.write(vbyte);
|
||||||
}
|
}
|
||||||
|
|
||||||
void kiss_indicate_reset() {
|
void kiss_indicate_reset() {
|
||||||
@ -327,10 +327,10 @@ void kiss_indicate_frequency() {
|
|||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void kiss_indicate_random(uint8_t byte) {
|
void kiss_indicate_random(uint8_t vbyte) {
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
Serial.write(CMD_RANDOM);
|
Serial.write(CMD_RANDOM);
|
||||||
Serial.write(byte);
|
Serial.write(vbyte);
|
||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,22 +474,22 @@ bool eeprom_info_locked() {
|
|||||||
|
|
||||||
void eeprom_dump_info() {
|
void eeprom_dump_info() {
|
||||||
for (int addr = ADDR_PRODUCT; addr <= ADDR_INFO_LOCK; addr++) {
|
for (int addr = ADDR_PRODUCT; addr <= ADDR_INFO_LOCK; addr++) {
|
||||||
uint8_t byte = EEPROM.read(eeprom_addr(addr));
|
uint8_t vbyte = EEPROM.read(eeprom_addr(addr));
|
||||||
escapedSerialWrite(byte);
|
escapedSerialWrite(vbyte);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_dump_config() {
|
void eeprom_dump_config() {
|
||||||
for (int addr = ADDR_CONF_SF; addr <= ADDR_CONF_OK; addr++) {
|
for (int addr = ADDR_CONF_SF; addr <= ADDR_CONF_OK; addr++) {
|
||||||
uint8_t byte = EEPROM.read(eeprom_addr(addr));
|
uint8_t vbyte = EEPROM.read(eeprom_addr(addr));
|
||||||
escapedSerialWrite(byte);
|
escapedSerialWrite(vbyte);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_dump_all() {
|
void eeprom_dump_all() {
|
||||||
for (int addr = 0; addr < EEPROM_RESERVED; addr++) {
|
for (int addr = 0; addr < EEPROM_RESERVED; addr++) {
|
||||||
uint8_t byte = EEPROM.read(eeprom_addr(addr));
|
uint8_t vbyte = EEPROM.read(eeprom_addr(addr));
|
||||||
escapedSerialWrite(byte);
|
escapedSerialWrite(vbyte);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,12 +500,12 @@ void kiss_dump_eeprom() {
|
|||||||
Serial.write(FEND);
|
Serial.write(FEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_update(int mapped_addr, uint8_t byte) {
|
void eeprom_update(int mapped_addr, uint8_t vbyte) {
|
||||||
#if MCU_VARIANT == MCU_1284P || MCU_VARIANT == MCU_2560
|
#if MCU_VARIANT == MCU_1284P || MCU_VARIANT == MCU_2560
|
||||||
EEPROM.update(mapped_addr, byte);
|
EEPROM.update(mapped_addr, vbyte);
|
||||||
#elif MCU_VARIANT == MCU_ESP32
|
#elif MCU_VARIANT == MCU_ESP32
|
||||||
if (EEPROM.read(mapped_addr) != byte) {
|
if (EEPROM.read(mapped_addr) != vbyte) {
|
||||||
EEPROM.write(mapped_addr, byte);
|
EEPROM.write(mapped_addr, vbyte);
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -565,8 +565,8 @@ bool eeprom_hwrev_valid() {
|
|||||||
bool eeprom_checksum_valid() {
|
bool eeprom_checksum_valid() {
|
||||||
char *data = (char*)malloc(CHECKSUMMED_SIZE);
|
char *data = (char*)malloc(CHECKSUMMED_SIZE);
|
||||||
for (uint8_t i = 0; i < CHECKSUMMED_SIZE; i++) {
|
for (uint8_t i = 0; i < CHECKSUMMED_SIZE; i++) {
|
||||||
char byte = EEPROM.read(eeprom_addr(i));
|
char vbyte = EEPROM.read(eeprom_addr(i));
|
||||||
data[i] = byte;
|
data[i] = vbyte;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *hash = MD5::make_hash(data, CHECKSUMMED_SIZE);
|
unsigned char *hash = MD5::make_hash(data, CHECKSUMMED_SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user