...
Owner: Rahul Ramkumar
Description
Facilitates STD32 RTOS timer interrupts for periodic callbacks, essential for consistent data dispatch to the ground station. This is just a way to abstract the process of creating a an RTOS timer interrupt on the STM32 boardand allow us to have access to the telemetry manager instance within the callback. This method will be used to generate timer interrupts to schedule regular data transmissions to the ground station.
...
Constructor Signature
void registerTimerInterrupt(int timeIntervalMs, void (*function)())
Parameters
...
timeIntervalMs
: The timer interval in milliseconds.
...
TimerInterrupt(const char* taskName, int stackSize, UBaseType_t uxPriority,
TickType_t intervalMs, TelemetryManager& tm, Callback cbLambda)
Parameters
taskName
: The RTOS task namestackSize
: Task stack size.uxPriority
: Task priority.intervalMs
: Callback interval.tm
: Reference to telemetry manager instance.cbLambda
: The callback function.
Note
Callback
is a type alias for std::function<void(TelemetryManager&)>
Implementation Details
Example of function execution; real application requires STM32 RTOS timer setup.
🔄 MavlinkTranslator
...
GroundStationComms GSC: Oversees ground station comms.
MavlinkTranslator MT: MAVLink message and byte stream translator.TimerInterrupt TI: Timer-based task manager.
🌐 Function: init
Description
...
Timer Interrupts: Configured for 500ms and 1000ms operation intervals.
FreeRTOS Tasks:
translateToMavlinkThread
: ProcessesGSC.DMAReceiveBuffer
bytes into MAVLink messages.mavlinkToBytesThread
: Loads MAVLink bytes intoGSC.lowPriorityTransmitBuffer
.
Scheduler: Engages the FreeRTOS scheduler for task oversight.
🗝 Function: getInstance
Description
...
.
🔄 Tasks and ISRs
translateToMavlinkThread & mavlinkToBytesThread: Converts between MAVLink messages and byte streams for drone-ground station communication.
TimerISR500ms & TimerISR1000ms: Ensures regular data dispatch from both
GSC.lowPriorityTransmitBuffer
andGSC.highPriorityTransmitBuffer
.
...