mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-02-24 08:50:05 -05:00
Cleanup
This commit is contained in:
parent
8cf6e9cb40
commit
6eaacb7f99
@ -383,6 +383,8 @@ char bt_devname[11];
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bt_flush() { if (bt_state == BT_STATE_CONNECTED) { SerialBT.flushTXD(); } }
|
||||||
|
|
||||||
void bt_disable_pairing() {
|
void bt_disable_pairing() {
|
||||||
bt_allow_pairing = false;
|
bt_allow_pairing = false;
|
||||||
bt_ssp_pin = 0;
|
bt_ssp_pin = 0;
|
||||||
|
7
Power.h
7
Power.h
@ -216,11 +216,8 @@ void measure_battery() {
|
|||||||
|
|
||||||
// if (bt_state == BT_STATE_CONNECTED) {
|
// if (bt_state == BT_STATE_CONNECTED) {
|
||||||
// SerialBT.printf("Bus voltage %.3fv. Unfiltered %.3fv.", battery_voltage, bat_v_samples[BAT_SAMPLES-1]);
|
// SerialBT.printf("Bus voltage %.3fv. Unfiltered %.3fv.", battery_voltage, bat_v_samples[BAT_SAMPLES-1]);
|
||||||
// if (bat_voltage_dropping) {
|
// if (bat_voltage_dropping) { SerialBT.printf(" Voltage is dropping. Percentage %.1f%%.", battery_percent); }
|
||||||
// SerialBT.printf(" Voltage is dropping. Percentage %.1f%%.", battery_percent);
|
// else { SerialBT.printf(" Voltage is not dropping. Percentage %.1f%%.", battery_percent); }
|
||||||
// } else {
|
|
||||||
// SerialBT.printf(" Voltage is not dropping. Percentage %.1f%%.", battery_percent);
|
|
||||||
// }
|
|
||||||
// if (battery_state == BATTERY_STATE_DISCHARGING) { SerialBT.printf(" Battery discharging. delay_v %.3fv", bat_delay_v); }
|
// if (battery_state == BATTERY_STATE_DISCHARGING) { SerialBT.printf(" Battery discharging. delay_v %.3fv", bat_delay_v); }
|
||||||
// if (battery_state == BATTERY_STATE_CHARGING) { SerialBT.printf(" Battery charging. delay_v %.3fv", bat_delay_v); }
|
// if (battery_state == BATTERY_STATE_CHARGING) { SerialBT.printf(" Battery charging. delay_v %.3fv", bat_delay_v); }
|
||||||
// if (battery_state == BATTERY_STATE_CHARGED) { SerialBT.print(" Battery is charged."); }
|
// if (battery_state == BATTERY_STATE_CHARGED) { SerialBT.print(" Battery is charged."); }
|
||||||
|
@ -732,13 +732,8 @@ void serial_write(uint8_t byte) {
|
|||||||
#if MCU_VARIANT == MCU_NRF52 && HAS_BLE
|
#if MCU_VARIANT == MCU_NRF52 && HAS_BLE
|
||||||
// This ensures that the TX buffer is flushed after a frame is queued in serial.
|
// This ensures that the TX buffer is flushed after a frame is queued in serial.
|
||||||
// serial_in_frame is used to ensure that the flush only happens at the end of the frame
|
// serial_in_frame is used to ensure that the flush only happens at the end of the frame
|
||||||
if (serial_in_frame && byte == FEND) {
|
if (serial_in_frame && byte == FEND) { SerialBT.flushTXD(); serial_in_frame = false; }
|
||||||
SerialBT.flushTXD();
|
else if (!serial_in_frame && byte == FEND) { serial_in_frame = true; }
|
||||||
serial_in_frame = false;
|
|
||||||
}
|
|
||||||
else if (!serial_in_frame && byte == FEND) {
|
|
||||||
serial_in_frame = true;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user