Scheduling on gruvin9x board

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Scheduling on gruvin9x board

Post by bertrand35 »

Scheduling on the new boards (ersky9x and gruvin9x) is now needed. The reason is simple, as an example it is not allowed to have the mixes calculation blocked behind a Log beeing written on the SD-card.

The scheduling is not really needed on stock board (there is no SD-card, and the EEPROM writes are done asynchronously, and moreover, there is no timer available). Also we plan to add an RTOS on ersky9x so the mechanism described below will not apply for these two boards.

So, this implementation is currently in the mixer_interrupt branch of open9x :
1) The mixers calculation are done in an interrupt (raised by Timer5)
2) When the interrupt raises, it schedules a new wakeup 20ms later
3) When setupPulses() is called (T0) it adjusts the mixer interrupt scheduled time so that the next wakeup will start at T1 - (mixer calculations last duration) - 500us
4) Everything else (the LCD, the Menus, the EEPROM, the SD-card) remains in the main program (therefore have the lowest priority).

Hope it makes sense and everything is clear. It is working, I still need to port everything to the trunk so that it doesn't change anything for stock and ersky9x boards.

Bertrand.

Post Reply

Return to “openTx”