autoformat per formatting rules

pull/96/head
geeksville 2020-04-17 18:50:07 -07:00
rodzic 8eb3045451
commit 176532f55f
1 zmienionych plików z 31 dodań i 45 usunięć

Wyświetl plik

@ -6,17 +6,8 @@
#include <RHGenericDriver.h>
RHGenericDriver::RHGenericDriver()
:
_mode(RHModeInitialising),
_thisAddress(RH_BROADCAST_ADDRESS),
_txHeaderTo(RH_BROADCAST_ADDRESS),
_txHeaderFrom(RH_BROADCAST_ADDRESS),
_txHeaderId(0),
_txHeaderFlags(0),
_rxBad(0),
_rxGood(0),
_txGood(0),
_cad_timeout(0)
: _mode(RHModeInitialising), _thisAddress(RH_BROADCAST_ADDRESS), _txHeaderTo(RH_BROADCAST_ADDRESS),
_txHeaderFrom(RH_BROADCAST_ADDRESS), _txHeaderId(0), _txHeaderFlags(0), _rxBad(0), _rxGood(0), _txGood(0), _cad_timeout(0)
{
}
@ -38,10 +29,8 @@ void RHGenericDriver::waitAvailable()
bool RHGenericDriver::waitAvailableTimeout(uint16_t timeout)
{
unsigned long starttime = millis();
while ((millis() - starttime) < timeout)
{
if (available())
{
while ((millis() - starttime) < timeout) {
if (available()) {
return true;
}
YIELD;
@ -59,8 +48,7 @@ bool RHGenericDriver::waitPacketSent()
bool RHGenericDriver::waitPacketSent(uint16_t timeout)
{
unsigned long starttime = millis();
while ((millis() - starttime) < timeout)
{
while ((millis() - starttime) < timeout) {
if (_mode != RHModeTx) // Any previous transmit finished?
return true;
YIELD;
@ -80,8 +68,7 @@ bool RHGenericDriver::waitCAD()
// 100 - 1000 ms
// 10 sec timeout
unsigned long t = millis();
while (isChannelActive())
{
while (isChannelActive()) {
if (millis() - t > _cad_timeout)
return false;
#if (RH_PLATFORM == RH_PLATFORM_STM32) // stdlib on STMF103 gets confused if random is redefined
@ -177,12 +164,10 @@ void RHGenericDriver::printBuffer(const char* prompt, const uint8_t* buf, uint8_
#ifdef RH_HAVE_SERIAL
Serial.println(prompt);
uint8_t i;
for (i = 0; i < len; i++)
{
for (i = 0; i < len; i++) {
if (i % 16 == 15)
Serial.println(buf[i], HEX);
else
{
else {
Serial.print(buf[i], HEX);
Serial.print(' ');
}
@ -216,6 +201,7 @@ void RHGenericDriver::setCADTimeout(unsigned long cad_timeout)
// get linking complaints from the default code generated for pure virtual functions
extern "C" void __cxa_pure_virtual()
{
while (1);
while (1)
;
}
#endif