@@ -11,7 +11,7 @@ void RadioControlTask::init()
1111#ifdef VERBOSE
1212 Serial.println (F (" Radio: Initializing ... " ));
1313#endif
14- // initialize SX1278 with default settings
14+ // Initialize SX1278 with default settings
1515 code = radio.begin (constants::radio::freq, constants::radio::bw, constants::radio::sf, constants::radio::cr,
1616 constants::radio::sw, constants::radio::pwr, constants::radio::pl, constants::radio::gn);
1717 if (code == RADIOLIB_ERR_NONE) {
@@ -28,7 +28,7 @@ void RadioControlTask::init()
2828#ifdef VERBOSE
2929 Serial.println (F (" Radio: Setting CRC parameter ... " ));
3030#endif
31- // set CRC parameter to true so it matches the CRC parameter on the TinyGS side
31+ // Set CRC parameter to true so it matches the CRC parameter on the TinyGS side
3232 code = radio.setCRC (true );
3333 if (code == RADIOLIB_ERR_NONE) {
3434 sfr::radio::start_progress++;
@@ -43,7 +43,7 @@ void RadioControlTask::init()
4343#ifdef VERBOSE
4444 Serial.println (F (" Radio: Setting forceLDRO parameter ... " ));
4545#endif
46- // set forceLDRO parameter to true so it matches the forceLDRO parameter on the TinyGS side
46+ // Set forceLDRO parameter to true so it matches the forceLDRO parameter on the TinyGS side
4747 code = radio.forceLDRO (true );
4848 if (code == RADIOLIB_ERR_NONE) {
4949 sfr::radio::initialized = true ;
@@ -60,7 +60,7 @@ void RadioControlTask::init()
6060
6161bool RadioControlTask::transmit (uint8_t *packet, uint8_t size)
6262{
63- // blink LED during transmit
63+ // Blink LED during transmit
6464 if (millis () - sfr::gps::boot_time > constants::led::led_on_time) {
6565 digitalWrite (constants::led::led_pin, HIGH);
6666 }
@@ -82,7 +82,7 @@ bool RadioControlTask::transmit(uint8_t *packet, uint8_t size)
8282#endif
8383
8484 if (code == RADIOLIB_ERR_NONE) {
85- // the packet was successfully transmitted
85+ // The packet was successfully transmitted
8686#ifdef VERBOSE
8787 Serial.println (F (" success!" ));
8888 Serial.print (F (" [SX1278] Datarate:\t " ));
@@ -93,10 +93,10 @@ bool RadioControlTask::transmit(uint8_t *packet, uint8_t size)
9393 } else {
9494#ifdef VERBOSE
9595 if (code == RADIOLIB_ERR_TX_TIMEOUT) {
96- // timeout occurred while transmitting packet
96+ // Timeout occurred while transmitting packet
9797 Serial.println (F (" timeout!" ));
9898 } else {
99- // some other error occurred
99+ // Some other error occurred
100100 Serial.print (F (" failed, code " ));
101101 Serial.println (code);
102102 }
@@ -131,13 +131,13 @@ bool RadioControlTask::receive()
131131 } else {
132132#ifdef VERBOSE
133133 if (code == RADIOLIB_ERR_RX_TIMEOUT) {
134- // timeout occurred while waiting for a packet
134+ // Timeout occurred while waiting for a packet
135135 Serial.println (F (" timeout!" ));
136136 } else if (code == RADIOLIB_ERR_CRC_MISMATCH) {
137- // packet was received, but is malformed
137+ // Packet was received, but is malformed
138138 Serial.println (F (" CRC error!" ));
139139 } else {
140- // some other error occurred
140+ // Some other error occurred
141141 Serial.print (F (" failed, code " ));
142142 Serial.println (code);
143143 }
@@ -148,7 +148,7 @@ bool RadioControlTask::receive()
148148
149149void RadioControlTask::execute ()
150150{
151- // implements the state machine described in: https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki
151+ // Implement the state machine described in https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki
152152 switch (sfr::radio::mode) {
153153 case radio_mode_type::init: {
154154#ifdef VERBOSE
@@ -177,24 +177,24 @@ void RadioControlTask::execute()
177177#ifdef VERBOSE
178178 Serial.println (F (" Radio: Downlink State" ));
179179#endif
180- // downlink when slot reached
180+ // Downlink when slot reached
181181 if (!sfr::radio::downlinked_in_slot && millis () - sfr::radio::downlink_window_start >= constants::radio::transmit_slot_length * sfr::radio::downlink_slot) {
182182 executeDownlink ();
183183 sfr::radio::downlinked_in_slot = true ;
184184 }
185185
186- // go into listen mode if listen period reached
186+ // Go into listen mode if listen period reached
187187 if (millis () - sfr::radio::listen_period_start >= constants::radio::listen_period) {
188188 sfr::radio::mode = radio_mode_type::listen;
189189
190190#ifdef VERBOSE
191191 Serial.println (F (" Radio: Listen Flag Downlink" ));
192192#endif
193- // downlink with listen flag = true
193+ // Downlink with listen flag = true
194194 normalReportDownlink ();
195195 sfr::radio::command_wait_start = millis ();
196196 }
197- // reset window and choose slot for next downlink
197+ // Reset window and choose slot for next downlink
198198 else if (millis () - sfr::radio::downlink_window_start >= sfr::radio::downlink_window_length) {
199199 downlinkSettings ();
200200 }
@@ -204,7 +204,7 @@ void RadioControlTask::execute()
204204#ifdef VERBOSE
205205 Serial.println (F (" Radio: Listen State" ));
206206#endif
207- // built in timeout is 100 LoRa symbols
207+ // Built in timeout is 100 LoRa symbols
208208 bool receive_success = receive ();
209209 if (receive_success) {
210210 processUplink ();
@@ -250,7 +250,7 @@ bool RadioControlTask::executeDownlink()
250250
251251bool RadioControlTask::normalReportDownlink ()
252252{
253- // see https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki/2.-Telemetry for more info
253+ // See https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki/2.-Telemetry for more info
254254 uint16_t lat = sfr::gps::latitude * 100 ;
255255 uint16_t lon = sfr::gps::longitude * 100 ;
256256 uint16_t alt = sfr::gps::altitude / 10 ;
@@ -300,7 +300,7 @@ uint8_t RadioControlTask::map_range(float value, int min_val, int max_val)
300300
301301void RadioControlTask::processUplink ()
302302{
303- // see https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki/3.-Commands for more info
303+ // See https://github.com/Alpha-CubeSat/oop-chipsat-code/wiki/3.-Commands for more info
304304 switch (received[0 ]) {
305305 case constants::opcodes::no_op: // No-Op
306306#ifdef VERBOSE
0 commit comments