Skip to content

Commit 3ce66e0

Browse files
committed
Updated while(1);
Signed-off-by: Michael Carlstrom <[email protected]>
1 parent a4d329d commit 3ce66e0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/float/float_transceiver/float_transceiver.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool isStartingStage = true;
103103
void setup() {
104104
Serial.begin(115200);
105105
// Wait until serial console is open; remove if not tethered to computer
106-
// while (!Serial) {}
106+
// while (!Serial);
107107

108108
Serial.println("Float Transceiver");
109109
Serial.println();
@@ -434,7 +434,7 @@ void initRadio() {
434434

435435
if (!rf95.init()) {
436436
Serial.println("RFM95 radio init failed");
437-
while (1) {}
437+
while (1);
438438
}
439439
Serial.println("RFM95 radio init OK!");
440440

src/float/surface_transceiver/surface_transceiver.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const String LEGAL_COMMANDS[] = {"submerge", "suck", "pump", "stop", "return"};
2626
void setup() {
2727
Serial.begin(115200);
2828
// Wait until serial console is open; remove if not tethered to computer
29-
while (!Serial) {}
29+
while (!Serial);
3030

3131
Serial.println("Surface Transceiver");
3232
pinMode(RFM95_RST, OUTPUT);
@@ -41,7 +41,7 @@ void setup() {
4141

4242
if (!rf95.init()) {
4343
Serial.println("RFM95 radio init failed");
44-
while (1) {}
44+
while (1);
4545
}
4646
Serial.println("RFM95 radio init OK!");
4747

@@ -50,7 +50,7 @@ void setup() {
5050
// But we override frequency
5151
if (!rf95.setFrequency(RF95_FREQ)) {
5252
Serial.println("setFrequency failed");
53-
while (1) {}
53+
while (1);
5454
}
5555

5656
// The default transmitter power is 13dBm, using PA_BOOST.
@@ -68,12 +68,12 @@ void loop() {
6868
Serial.println("Getting serial command...");
6969
String command = Serial.readString();
7070

71-
if (command.startsWith("submerge")) {
71+
if (command.equals("submerge")) {
7272
printRFStatus = false;
7373
}
7474

7575
for (auto legalCommand : LEGAL_COMMANDS) {
76-
if (command.startsWith(legalCommand)) {
76+
if (command.equals(legalCommand)) {
7777
sendCommand(legalCommand);
7878
return;
7979
}
@@ -158,8 +158,8 @@ bool receivePacket() {
158158
byteBuffer[PKT_IDX_PROFILE_HALF]);
159159
for (int i = PKT_HEADER_LEN; i < len;) {
160160
// Wonky pointer casting to convert four bytes into a long (time)
161-
serialPrintf("%l,", *reinterpret_cast<uint32_t*>(byteBuffer + i));
162-
i += sizeof(uint32_t);
161+
serialPrintf("%l,", *reinterpret_cast<unsigned long*>(byteBuffer + i));
162+
i += sizeof(unsigned long);
163163

164164
// Same thing for a float (pressure)
165165
Serial.print(*reinterpret_cast<float*>(byteBuffer + i));

0 commit comments

Comments
 (0)