diff --git a/MIDAS/.gitignore b/MIDAS/.gitignore index 4ba81f14..15541236 100644 --- a/MIDAS/.gitignore +++ b/MIDAS/.gitignore @@ -1,5 +1,4 @@ .pio .vscode -/src/log_checksum.h **/.DS_Store *.launch diff --git a/MIDAS/lib/ADS7138Q1/ads7138-q1.cpp b/MIDAS/lib/ADS7138Q1/ads7138-q1.cpp index 2e8630e1..5a0c1de4 100644 --- a/MIDAS/lib/ADS7138Q1/ads7138-q1.cpp +++ b/MIDAS/lib/ADS7138Q1/ads7138-q1.cpp @@ -66,6 +66,8 @@ bool ADS7138Init(){ AdcRegReadResult reg = adc_reg_read(ADC_ADDR, ADC_SYSTEM_STATUS); if(reg.error != AdcError::NoError){ return false; + } else{ + //process profiling continuity sensor initialize error } return reg.value != 0; } diff --git a/MIDAS/lib/ADXL355/PL_ADXL355.cpp b/MIDAS/lib/ADXL355/PL_ADXL355.cpp index d7b743b7..a41dc29e 100644 --- a/MIDAS/lib/ADXL355/PL_ADXL355.cpp +++ b/MIDAS/lib/ADXL355/PL_ADXL355.cpp @@ -136,6 +136,7 @@ namespace PL { SPI.begin(); pinMode(csPin, OUTPUT); digitalWrite(csPin, HIGH); + //process profiling acceleration lowG } //============================================================================== diff --git a/MIDAS/lib/Adafruit BNO08x/src/Adafruit_BNO08x.cpp b/MIDAS/lib/Adafruit BNO08x/src/Adafruit_BNO08x.cpp index f66369fa..53eebdd8 100644 --- a/MIDAS/lib/Adafruit BNO08x/src/Adafruit_BNO08x.cpp +++ b/MIDAS/lib/Adafruit BNO08x/src/Adafruit_BNO08x.cpp @@ -180,7 +180,7 @@ bool Adafruit_BNO08x::begin_SPI(uint8_t cs_pin, uint8_t int_pin, _HAL.getTimeUs = hal_getTimeUs; return _init(sensor_id); -} +}//process profiling orientation /*! @brief Initializer for post i2c/spi init * @param sensor_id Optional unique ID for the sensor set diff --git a/MIDAS/lib/Arduino_LSM6DS3/src/LSM6DS3.cpp b/MIDAS/lib/Arduino_LSM6DS3/src/LSM6DS3.cpp index a695df41..e1627e4d 100644 --- a/MIDAS/lib/Arduino_LSM6DS3/src/LSM6DS3.cpp +++ b/MIDAS/lib/Arduino_LSM6DS3/src/LSM6DS3.cpp @@ -66,9 +66,9 @@ int LSM6DS3Class::begin() // Set the ODR config register to ODR/4 writeRegister(LSM6DS3_CTRL8_XL, 0x09); - + //process profiling acceleration initialized return 1; -} +}//process profiling lowglsm void LSM6DS3Class::end() { diff --git a/MIDAS/lib/MS5611/MS5611.cpp b/MIDAS/lib/MS5611/MS5611.cpp index 74852587..9d9479af 100644 --- a/MIDAS/lib/MS5611/MS5611.cpp +++ b/MIDAS/lib/MS5611/MS5611.cpp @@ -77,7 +77,7 @@ void MS5611::init() { C[reg] = readProm(reg); } SPI.endTransaction(); -} +}//process profiling barometer initialized int MS5611::read(uint8_t bits) { // VARIABLES NAMES BASED ON DATASHEET <- Nice! diff --git a/MIDAS/lib/SparkFun_KX13X_Arduino_Library-1.0.7/src/SparkFun_Qwiic_KX13X.cpp b/MIDAS/lib/SparkFun_KX13X_Arduino_Library-1.0.7/src/SparkFun_Qwiic_KX13X.cpp index f43986f3..3b2cbbf6 100644 --- a/MIDAS/lib/SparkFun_KX13X_Arduino_Library-1.0.7/src/SparkFun_Qwiic_KX13X.cpp +++ b/MIDAS/lib/SparkFun_KX13X_Arduino_Library-1.0.7/src/SparkFun_Qwiic_KX13X.cpp @@ -617,7 +617,7 @@ bool QwiicKX134::beginSPI(uint8_t csPin, uint32_t spiPortSpeed, return true; else return false; -} +}//process profiling acceleration highG // Grabs raw accel data and passes it to the following function to be // converted. diff --git a/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.cpp b/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.cpp index ed9c79c8..fbe496e8 100644 --- a/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.cpp +++ b/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.cpp @@ -48,6 +48,7 @@ + /* * Constant for strtol base param */ @@ -99,6 +100,10 @@ GNSS_StatusTypeDef TeseoLIV3F::I2CUpdate() { GNSS_PARSER_ParseMsg(&data, (eNMEAMsg)m, buffer); } + } else{ + //process profiling + //LogMessage error; + //error.message = 'GNSS PARSER ERROR'; } strncpy(i2ch.inputString, i2ch.inputString2, sizeof(i2ch.inputString)); memset(i2ch.inputString2, 0, sizeof(i2ch.inputString2)); @@ -127,6 +132,8 @@ GNSS_StatusTypeDef TeseoLIV3F::UARTUpdate() { GNSS_PARSER_ParseMsg(&data, (eNMEAMsg)m, buffer); } + } else{ + //process profiling } memset(uarth.inputString, 0, sizeof(uarth.inputString)); uarth.stringComplete = false; diff --git a/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.h b/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.h index 657b5068..d2832cda 100644 --- a/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.h +++ b/MIDAS/lib/X-NUCLEO-GNSS1A1/src/teseo_liv3f_class.h @@ -132,7 +132,7 @@ class TeseoLIV3F Wire.endTransmission(false); delay(2000); return GNSS_OK; - } + }//process profiling /** * @brief Update the internal data structures of the sensor using the appropriate communication method diff --git a/MIDAS/src/data_logging.cpp b/MIDAS/src/data_logging.cpp index e6cb5ce2..08db0ffe 100644 --- a/MIDAS/src/data_logging.cpp +++ b/MIDAS/src/data_logging.cpp @@ -1,7 +1,7 @@ #include "data_logging.h" #include "log_format.h" #include "log_checksum.h" - +#include /** * @brief Forward decleration of the ID recieving function */ @@ -11,6 +11,10 @@ constexpr ReadingDiscriminant get_discriminant(); /** * @brief macro to associate a certain sensor with a specific number ID */ + +//std::queue logQueue; // data logging for process profiling + + #define ASSOCIATE(ty, id) template<> constexpr ReadingDiscriminant get_discriminant() { return ReadingDiscriminant::id; } ASSOCIATE(LowGData, ID_LOWG) @@ -25,6 +29,8 @@ ASSOCIATE(Orientation, ID_ORIENTATION) ASSOCIATE(FSMState, ID_FSM) ASSOCIATE(KalmanData, ID_KALMAN) ASSOCIATE(PyroState, ID_PYRO) +ASSOCIATE(ProcessTime, ID_PROCESSTIME); +ASSOCIATE(LogMessages, ID_LOGMESSAGES) /** * @brief writes a reading, with its ID, timestamp, and data to a specific sink @@ -88,6 +94,8 @@ void log_data(LogSink& sink, RocketData& data) { log_from_sensor_data(sink, data.fsm_state); log_from_sensor_data(sink, data.kalman); log_from_sensor_data(sink, data.pyro); + log_from_sensor_data(sink, data.processTime); + log_from_sensor_data(sink, data.logMessages); } #ifndef SILSIM diff --git a/MIDAS/src/hardware/Barometer.cpp b/MIDAS/src/hardware/Barometer.cpp index 8adae988..8536a45d 100644 --- a/MIDAS/src/hardware/Barometer.cpp +++ b/MIDAS/src/hardware/Barometer.cpp @@ -1,7 +1,9 @@ #include "sensors.h" #include +#include MS5611 MS(MS5611_CS); //singleton object for the MS sensor +extern std::queue logQueue; /** * @brief Initializes barometer, returns NoError @@ -10,7 +12,8 @@ MS5611 MS(MS5611_CS); //singleton object for the MS sensor */ ErrorCode BarometerSensor::init() { MS.init(); - + //process profiling + logQueue.push("BarometerInitialized"); return ErrorCode::NoError; } diff --git a/MIDAS/src/hardware/Continuity.cpp b/MIDAS/src/hardware/Continuity.cpp index a57a5ab0..3aba09c4 100644 --- a/MIDAS/src/hardware/Continuity.cpp +++ b/MIDAS/src/hardware/Continuity.cpp @@ -1,9 +1,12 @@ #include "sensors.h" #include "ads7138-q1.h" #include +#include + #define PYRO_VOLTAGE_DIVIDER (5.0 / (5.0 + 20.0)) //voltage divider for pyro batt voltage, check hardware schematic #define CONT_VOLTAGE_DIVIDER (5.0 / (5.0 + 20.0)) //voltage divider for continuity voltage, check hardware schematic +extern std::queue logQueue; /** * @brief Initializes ADC, returns NoError @@ -12,7 +15,7 @@ */ ErrorCode ContinuitySensor::init() { ADS7138Init(); // Ask ADS to init the pins, we still need to get the device to actually read - + logQueue.push("BarometerInitialized");//process profiling return ErrorCode::NoError; } diff --git a/MIDAS/src/hardware/Emmc.cpp b/MIDAS/src/hardware/Emmc.cpp index 06bbd5bf..86806108 100644 --- a/MIDAS/src/hardware/Emmc.cpp +++ b/MIDAS/src/hardware/Emmc.cpp @@ -37,6 +37,6 @@ ErrorCode EMMCSink::init(){ if (!file) { return ErrorCode::EmmcCouldNotOpenFile; } - + //process profiling return ErrorCode::NoError; } diff --git a/MIDAS/src/hardware/GPSSensor.cpp b/MIDAS/src/hardware/GPSSensor.cpp index 460d2b8a..5de20c26 100644 --- a/MIDAS/src/hardware/GPSSensor.cpp +++ b/MIDAS/src/hardware/GPSSensor.cpp @@ -16,7 +16,7 @@ TeseoLIV3F teseo(&Wire, GPS_RESET, GPS_ENABLE); // singleton for the teseo g */ ErrorCode GPSSensor::init() { teseo.init(); // always returns ok for some reason - + //process profiling return ErrorCode::NoError; } diff --git a/MIDAS/src/hardware/HighG.cpp b/MIDAS/src/hardware/HighG.cpp index 1123f9bd..bcc033f3 100644 --- a/MIDAS/src/hardware/HighG.cpp +++ b/MIDAS/src/hardware/HighG.cpp @@ -1,7 +1,9 @@ #include "sensors.h" #include "SparkFun_Qwiic_KX13X.h" +#include QwiicKX134 KX; // global static instance of the sensor +extern std::queue logQueue; /** * @brief Initializes the high G sensor @@ -11,15 +13,22 @@ QwiicKX134 KX; // global static instance of the sensor ErrorCode HighGSensor::init() { KX.beginSPI(KX134_CS); if (!KX.initialize(DEFAULT_SETTINGS)) { + + logQueue.push("HighGCouldNotBeInitialized");//process profiling return ErrorCode::HighGCouldNotBeInitialized; } if(!KX.setOutputDataRate(0xb)) { + logQueue.push("HighGCouldNotUpdateDataRate");//process profiling return ErrorCode::HighGCouldNotUpdateDataRate; } + + logQueue.push("HighGInitialized");//process profiling KX.setRange(3); return ErrorCode::NoError; + + } /** diff --git a/MIDAS/src/hardware/LowG.cpp b/MIDAS/src/hardware/LowG.cpp index 1eac7371..31f9fae5 100644 --- a/MIDAS/src/hardware/LowG.cpp +++ b/MIDAS/src/hardware/LowG.cpp @@ -16,7 +16,8 @@ ErrorCode LowGSensor::init() { // todo set low pass filter frequency to 250hx sensor.enableMeasurement(); return error; -} + //process profiling +} /** * @brief Reads and returns the data from the sensor diff --git a/MIDAS/src/hardware/LowGLSM.cpp b/MIDAS/src/hardware/LowGLSM.cpp index 951be540..78992e85 100644 --- a/MIDAS/src/hardware/LowGLSM.cpp +++ b/MIDAS/src/hardware/LowGLSM.cpp @@ -13,6 +13,7 @@ ErrorCode LowGLSMSensor::init() { return ErrorCode::GyroCouldNotBeInitialized; } return ErrorCode::NoError; + //process profiling } /** diff --git a/MIDAS/src/hardware/Magnetometer.cpp b/MIDAS/src/hardware/Magnetometer.cpp index 23ef322d..2686341c 100644 --- a/MIDAS/src/hardware/Magnetometer.cpp +++ b/MIDAS/src/hardware/Magnetometer.cpp @@ -1,8 +1,10 @@ #include - +#include #include "sensors.h" #include "hal.h" +extern std::queue logQueue; // global variable queue for logging the important status of the sensor. + Adafruit_LIS3MDL LIS3MDL; // global static instance of the sensor ErrorCode MagnetometerSensor::init() { @@ -11,9 +13,13 @@ ErrorCode MagnetometerSensor::init() { } LIS3MDL.setOperationMode(LIS3MDL_CONTINUOUSMODE); // Reading continuously, instead of single-shot or off LIS3MDL.setDataRate(LIS3MDL_DATARATE_155_HZ); - LIS3MDL.setRange(LIS3MDL_RANGE_4_GAUSS); // Earth's magnetic field is 1/2 gauss, can detect high current + LIS3MDL.setRange(LIS3MDL_RANGE_4_GAUSS); + // Earth's magnetic field is 1/2 gauss, can detect high current + char message[64]; + snprintf(message, sizeof(message), "MagnetometerInitizedW/Mode:%dRate:%dRange:%d", LIS3MDL_CONTINUOUSMODE, static_cast(LIS3MDL_DATARATE_155_HZ), LIS3MDL_RANGE_4_GAUSS); + logQueue.push(message); return ErrorCode::NoError; -} +}//process profiling Magnetometer MagnetometerSensor::read() { // read from aforementioned global instance of sensor @@ -25,3 +31,9 @@ Magnetometer MagnetometerSensor::read() { Magnetometer reading{mx, my, mz}; return reading; } + +//void addMessageQueue(String m){ + // char message[64]; + //snprintf(message, sizeof(message), m); + //logQueue.push(message); +//} \ No newline at end of file diff --git a/MIDAS/src/hardware/Orientation.cpp b/MIDAS/src/hardware/Orientation.cpp index 0d6a3526..3ccbe4ba 100644 --- a/MIDAS/src/hardware/Orientation.cpp +++ b/MIDAS/src/hardware/Orientation.cpp @@ -23,7 +23,7 @@ ErrorCode OrientationSensor::init() { return ErrorCode::CannotInitBNO; } return ErrorCode::NoError; -} +}//process profiling /** * @brief Turns a quaternion into its corresponding Euler 3D vector representation diff --git a/MIDAS/src/hardware/Pyro.cpp b/MIDAS/src/hardware/Pyro.cpp index 1c5c3bdb..ee374c26 100644 --- a/MIDAS/src/hardware/Pyro.cpp +++ b/MIDAS/src/hardware/Pyro.cpp @@ -55,7 +55,7 @@ ErrorCode Pyro::init() { // } else { return ErrorCode::NoError; // GPIO Driver always claimes it errored even when it doesn't. // } -} +}//process profiling #ifdef IS_SUSTAINER diff --git a/MIDAS/src/hardware/SDLog.cpp b/MIDAS/src/hardware/SDLog.cpp index bb8d1879..6593aa3a 100644 --- a/MIDAS/src/hardware/SDLog.cpp +++ b/MIDAS/src/hardware/SDLog.cpp @@ -30,7 +30,7 @@ ErrorCode SDSink::init() { } return ErrorCode::NoError; -} +}//process profiling /** * @brief Writes a byte buffer to the SD card diff --git a/MIDAS/src/log_checksum.h b/MIDAS/src/log_checksum.h new file mode 100644 index 00000000..4abe9b14 --- /dev/null +++ b/MIDAS/src/log_checksum.h @@ -0,0 +1,2 @@ +// autogenerated on build by applying crc32 on the concatenation of log_format.h and sensor_data.h +#define LOG_CHECKSUM (0xb8f3527e) diff --git a/MIDAS/src/log_format.h b/MIDAS/src/log_format.h index dde361bb..4f5f00c2 100644 --- a/MIDAS/src/log_format.h +++ b/MIDAS/src/log_format.h @@ -20,6 +20,8 @@ enum ReadingDiscriminant { ID_FSM = 10, ID_KALMAN = 11, ID_PYRO = 12, + ID_PROCESSTIME = 13, + ID_LOGMESSAGES = 14 }; @@ -51,5 +53,7 @@ struct LoggedReading { KalmanData kalman; FSMState fsm; PyroState pyro; + ProcessTime processtime; + LogMessages logMessages; } data; }; diff --git a/MIDAS/src/rocket_state.h b/MIDAS/src/rocket_state.h index 139acd3d..0a7cafcb 100644 --- a/MIDAS/src/rocket_state.h +++ b/MIDAS/src/rocket_state.h @@ -176,6 +176,8 @@ struct RocketData { SensorData magnetometer; SensorData orientation; SensorData voltage; + SensorData processTime; + SensorData logMessages; Latency log_latency; }; diff --git a/MIDAS/src/sensor_data.h b/MIDAS/src/sensor_data.h index d6b8b765..4b551030 100644 --- a/MIDAS/src/sensor_data.h +++ b/MIDAS/src/sensor_data.h @@ -229,3 +229,33 @@ struct PyroState { bool is_global_armed = false; PyroChannel channels[4]; }; + +enum class ProcessName { + TELEMETRY = 1, + ORIENTATION = 2, + KALMAN = 3, + BUZZER = 4, + FSM = 5, + I2C = 6, + MAGNETOMETER = 7, + ACCELEROMETERS = 8, + BAROMETER = 9, + LOGGER = 10 +}; + +/** + * @struct ProcessTime + * + * @brief The process time of the processes in the thread +*/ +struct ProcessTime +{ + ProcessName name; + float dt; +}; + +struct LogMessages +{ + char message[64]; +}; + diff --git a/MIDAS/src/systems.cpp b/MIDAS/src/systems.cpp index 36bff5b8..439defc6 100644 --- a/MIDAS/src/systems.cpp +++ b/MIDAS/src/systems.cpp @@ -1,5 +1,7 @@ #include "systems.h" +#include + #include "hal.h" #include "gnc/yessir.h" @@ -9,6 +11,19 @@ #error "At least one of IS_SUSTAINER and IS_BOOSTER must be defined." #endif +#define DEBUG + +#ifdef DEBUG + #define MEASURE_LOOP_TIME(startTime, processName, arg) \ + ProcessTime new_processTime; \ + new_processTime.dt = pdTICKS_TO_MS(xTaskGetTickCount() - startTime);; \ + new_processTime.name = processName; \ + arg->rocket_data.processTime.update(new_processTime); +#else + #define MEASURE_LOOP_TIME(startTime, processName, arg) \ // No-op in release mode +#endif + +std::queue logQueue; /** * @brief These are all the functions that will run in each task @@ -19,24 +34,47 @@ DECLARE_THREAD(logger, RocketSystems* arg) { log_begin(arg->log_sink); while (true) { + TickType_t startTime = xTaskGetTickCount(); + log_data(arg->log_sink, arg->rocket_data); arg->rocket_data.log_latency.tick(); + + MEASURE_LOOP_TIME(startTime, ProcessName::LOGGER, arg); THREAD_SLEEP(1); } } +DECLARE_THREAD(messages, RocketSystems* arg){ + while(true){ + if(!logQueue.empty()){ + LogMessages newMessage; + std::strncpy(newMessage.message, logQueue.front().c_str(), sizeof(newMessage.message) - 1); + newMessage.message[sizeof(newMessage.message) - 1] = '\0'; + arg->rocket_data.logMessages.update(newMessage); + THREAD_SLEEP(20); + } + } +} + DECLARE_THREAD(barometer, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + Barometer reading = arg->sensors.barometer.read(); arg->rocket_data.barometer.update(reading); + + MEASURE_LOOP_TIME(startTime, ProcessName::BAROMETER, arg); + THREAD_SLEEP(6); } } DECLARE_THREAD(accelerometers, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + #ifdef IS_SUSTAINER LowGData lowg = arg->sensors.low_g.read(); arg->rocket_data.low_g.update(lowg); @@ -45,25 +83,37 @@ DECLARE_THREAD(accelerometers, RocketSystems* arg) { arg->rocket_data.low_g_lsm.update(lowglsm); HighGData highg = arg->sensors.high_g.read(); arg->rocket_data.high_g.update(highg); + + MEASURE_LOOP_TIME(startTime, ProcessName::ACCELEROMETERS, arg); + THREAD_SLEEP(2); } } DECLARE_THREAD(orientation, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + Orientation reading = arg->sensors.orientation.read(); if (reading.has_data) { arg->rocket_data.orientation.update(reading); } + MEASURE_LOOP_TIME(startTime, ProcessName::ORIENTATION, arg); + THREAD_SLEEP(100); } } DECLARE_THREAD(magnetometer, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + Magnetometer reading = arg->sensors.magnetometer.read(); arg->rocket_data.magnetometer.update(reading); + + MEASURE_LOOP_TIME(startTime, ProcessName::MAGNETOMETER, arg); + THREAD_SLEEP(50); //data rate is 155hz so 7 is closest } } @@ -73,6 +123,8 @@ DECLARE_THREAD(i2c, RocketSystems* arg) { int i = 0; while (true) { + TickType_t startTime = xTaskGetTickCount(); + if (i % 10 == 0) { GPS reading = arg->sensors.gps.read(); arg->rocket_data.gps.update(reading); @@ -91,6 +143,8 @@ DECLARE_THREAD(i2c, RocketSystems* arg) { arg->led.update(); i += 1; + MEASURE_LOOP_TIME(startTime, ProcessName::I2C, arg); + THREAD_SLEEP(10); } } @@ -100,6 +154,8 @@ DECLARE_THREAD(fsm, RocketSystems* arg) { FSM fsm{}; bool already_played_freebird = false; while (true) { + TickType_t startTime = xTaskGetTickCount(); + FSMState current_state = arg->rocket_data.fsm_state.getRecentUnsync(); StateEstimate state_estimate(arg->rocket_data); @@ -112,14 +168,20 @@ DECLARE_THREAD(fsm, RocketSystems* arg) { already_played_freebird = true; } + MEASURE_LOOP_TIME(startTime, ProcessName::FSM, arg); + THREAD_SLEEP(50); } } DECLARE_THREAD(buzzer, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + arg->buzzer.tick(); + MEASURE_LOOP_TIME(startTime, ProcessName::BUZZER, arg); + THREAD_SLEEP(10); } } @@ -129,6 +191,7 @@ DECLARE_THREAD(kalman, RocketSystems* arg) { TickType_t last = xTaskGetTickCount(); while (true) { + TickType_t startTime = xTaskGetTickCount(); // add the tick update function Barometer current_barom_buf = arg->rocket_data.barometer.getRecentUnsync(); LowGData current_accelerometer = arg->rocket_data.low_g.getRecentUnsync(); @@ -143,17 +206,24 @@ DECLARE_THREAD(kalman, RocketSystems* arg) { KalmanData current_state = yessir.getState(); arg->rocket_data.kalman.update(current_state); - last = xTaskGetTickCount(); + MEASURE_LOOP_TIME(startTime, ProcessName::KALMAN, arg); + + THREAD_SLEEP(50); } } DECLARE_THREAD(telemetry, RocketSystems* arg) { while (true) { + TickType_t startTime = xTaskGetTickCount(); + arg->tlm.transmit(arg->rocket_data, arg->led); + MEASURE_LOOP_TIME(startTime, ProcessName::TELEMETRY, arg); + + THREAD_SLEEP(1); } } diff --git a/ground/lib/RadioHead/RH_RF95.cpp b/ground/lib/RadioHead/RH_RF95.cpp index 655bbabe..a22f5e67 100644 --- a/ground/lib/RadioHead/RH_RF95.cpp +++ b/ground/lib/RadioHead/RH_RF95.cpp @@ -188,7 +188,7 @@ void RH_RF95::handleInterrupt() // our ISR will be reinvoked to handle that case) // kevinh: turn this off until root cause is known, because it can cause missed interrupts! // spiWrite(RH_RF95_REG_12_IRQ_FLAGS, 0xff); // Clear all IRQ flags - spiWrite(RH_RF95_REG_12_IRQ_FLAGS, 0xff); // Clear all IRQ flags + spiWrite(RH_RF95_REG_12_IRQ_FLAGS, 0xff); // Clear all IRQ flags // error if: // timeout