Skip to content

Commit 1f107a3

Browse files
committed
removed some macro'ed out code from main and main1
1 parent c2e97be commit 1f107a3

2 files changed

Lines changed: 2 additions & 76 deletions

File tree

ascendfsw/src/main.cpp

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,6 @@ void setup() {
135135
}
136136
}
137137

138-
#if 0 // header stuff
139-
// build csv header
140-
String header = "Header,Millis,";
141-
for (int i = 0; i < sensors_len; i++) {
142-
if (sensors_verify[i]) {
143-
header += sensors[i]->getSensorCSVHeader();
144-
}
145-
}
146-
log_data(header);
147-
148-
// store header
149-
// storeData(header);
150-
#if FLASH_SPI1 == 0
151-
flash_storage.store(header);
152-
#endif
153-
154-
// send header to core1
155-
queue_add_blocking(&qt, header.c_str());
156-
#endif
157-
158138
pinMode(ON_BOARD_LED_PIN, OUTPUT);
159139
log_core("Setup done.");
160140
}
@@ -200,21 +180,14 @@ void loop() {
200180
// for (int i = 0; i < QT_ENTRY_SIZE; i++) packet[i] = 0; // useful for
201181
// debugging
202182
uint16_t packet_len = readSensorDataPacket(packet);
203-
#if STORING_PACKETS == false
204-
String csv_row = decodePacket(packet);
205-
#endif
206183

207184
// print csv row
208185
// log_data(csv_row);
209186
log_data_raw(packet, packet_len);
210187

211188
// send data to core1
212-
#if STORING_PACKETS
213189
// queue_add_blocking(&qt, packet);
214190
queue_try_add(&qt, packet);
215-
#else
216-
queue_add_blocking(&qt, csv_row.c_str());
217-
#endif
218191

219192
delay(500); // remove before flight
220193
}
@@ -308,42 +281,6 @@ void handleCommand() {
308281
setCmdData(cmd_data);
309282
}
310283

311-
#if 0 // part of the old verification system
312-
/**
313-
* @brief Verifies each sensor by calling each verify() function
314-
*
315-
* @return int The number of verified sensors
316-
*/
317-
int verifySensors() {
318-
int count = 0;
319-
uint32_t bit_array = 0b11; // start with a bit for header and for millis
320-
// (they will always be there)
321-
for (int i = 0; i < sensors_len; i++) {
322-
sensors_verify[i] = sensors[i]->verify();
323-
if (sensors_verify[i]) {
324-
count++;
325-
bit_array =
326-
(bit_array << 1) | 0b1; // if the sensor is verified shift a 1 in
327-
} else {
328-
bit_array = (bit_array << 1); // otherwise shift a 0 in
329-
}
330-
}
331-
header_condensed =
332-
String(bit_array, HEX); // translate it to hex to condense it for the csv
333-
334-
log_core("Pin Verification Results:");
335-
for (int i = 0; i < sensors_len; i++) {
336-
log_core((sensors[i]->getDeviceName()) + ": " +
337-
(sensors_verify[i]
338-
? "Successful in Communication"
339-
: "Failure in Communication (check wirings and/ or pin "
340-
"definitions)"));
341-
}
342-
log_core("");
343-
return count;
344-
}
345-
#endif
346-
347284
/**
348285
* @brief Reads sensor data into a packet byte array
349286
*

ascendfsw/src/main1.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ int it2 = 0;
7575
*
7676
*/
7777
void real_loop1() {
78-
#if STORING_PACKETS
7978
uint8_t received_data[QT_ENTRY_SIZE];
80-
#else
81-
char received_data[QT_ENTRY_SIZE];
82-
#endif
8379

8480
// toggle heartbeat
8581
it2++;
@@ -92,23 +88,16 @@ void real_loop1() {
9288
// Retrieve sensor data from queue
9389
queue_remove_blocking(&qt, received_data);
9490

95-
#if STORING_PACKETS
9691
unsigned long timestamp;
9792
memcpy(
9893
&timestamp,
9994
received_data + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint16_t),
10095
sizeof(timestamp));
10196
log_core("Packet Received with Millis = " + String(timestamp));
102-
#else
103-
log_core("Received: " + String(received_data));
104-
#endif
10597

106-
// store csv row
107-
#if STORING_PACKETS
98+
// store csv row
10899
storeDataPacket(received_data);
109-
#else
110-
storeData(String(received_data));
111-
#endif
100+
112101
}
113102

114103
// Determine if a command has been received

0 commit comments

Comments
 (0)