|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The IOmcu's firmware update, as the panel offers and shows it. More...
Go to the source code of this file.
Data Structures | |
| struct | cu_version_t |
| struct | cu_feed_t |
| struct | cu_driver_t |
| struct | cu_hand_t |
Enumerations | |
| enum | cu_view_t { CU_VIEW_QUESTION = 0 , CU_VIEW_PROGRESS } |
| enum | cu_step_t { CU_STEP_PREPARE = 0 , CU_STEP_SEND , CU_STEP_VERIFY , CU_STEP_RESTART , CU_STEP_BUY } |
| enum | cu_check_t { CU_CHECK_NONE = 0 , CU_CHECK_RUNNING , CU_CHECK_SAME , CU_CHECK_DIFFERENT , CU_CHECK_USB , CU_CHECK_FAILED , CU_CHECK_UPDATING } |
| enum | cu_sec_t { CU_SEC_NO_IMAGE = 0 , CU_SEC_BUSY , CU_SEC_NO_LINK , CU_SEC_UNKNOWN , CU_SEC_CHECKING , CU_SEC_FAILED , CU_SEC_USB , CU_SEC_SAME , CU_SEC_UNSAFE , CU_SEC_RADIO , CU_SEC_INSTALL , CU_SEC_READY } |
Functions | |
| bool | coproc_update_older (cu_version_t running, cu_version_t carried) |
| void | coproc_update_screen_offer (cu_version_t running, cu_version_t carried) |
| void | coproc_update_screen_progress (cu_step_t step, uint16_t block, uint16_t blocks) |
| cu_view_t | coproc_update_screen_view (void) |
| bool | coproc_update_screen_take_start (void) |
| bool | coproc_update_screen_take_cancel (void) |
| void | coproc_update_screen_invalidate (void) |
| cu_sec_t | coproc_update_section (const cu_driver_t *d, const cu_feed_t *f, bool unsafe) |
| void | coproc_update_drive (cu_driver_t *d, const cu_feed_t *f, bool unsafe, cu_hand_t *out) |
| const ui_screen_t * | coproc_update_screen (void) |
The IOmcu's firmware update, as the panel offers and shows it.
Two views. The question: which version the IOmcu runs, which one this panel carries, whether that one is older, CANCEL and START. START takes the 2s hold (UI_HOLD_S), the ARM gesture. The progress: a full screen without the band, like the bus-fault screen, with the step under way and the blocks sent. The bench cannot be armed while it shows: the IOmcu refuses ARM for the whole update session.
The screen decides nothing about the update. The application offers it, takes START or CANCEL from the latches, reports the step, and moves the router away when the update has ended.
SETUP > UPDATES starts the same update from its IOmcu section, offered or declined: coproc_update_section() says whether it may and why not, and coproc_update_drive() hands UPDATES that answer every frame, takes its hold, opens the progress and returns to UPDATES at the end.
SPDX-License-Identifier: MIT
| enum cu_check_t |
The control task's last look at the IOmcu's build.
| enum cu_sec_t |
UPDATES' IOmcu section: whether its hold may start the update, and if not why. coproc_update_section() picks the first that holds, in this order. Only CU_SEC_READY takes the hold.
| enum cu_step_t |
| void coproc_update_drive | ( | cu_driver_t * | d, |
| const cu_feed_t * | f, | ||
| bool | unsafe, | ||
| cu_hand_t * | out ) |
The screen's half of the update, once a frame, whichever screen is current: moves the router to the question, the progress and back, and drains both latches.
Leaving the question any way but START – CANCEL, the HOME tag, an alert, STOP, any jump of the router – latches CANCEL on the way out, after the router has left the screen; the latch is drained here on the next frame and handed over as a decline while the offer stands. The question opens once per offer, on the overview of a bench that is not unsafe, with the radio wholly off and no panel install under way.
And UPDATES' section: its state (coproc_update_section()) and the two versions go to upd_screen_set_coproc() every frame, and a completed hold (upd_screen_take_coproc()) on a section still READY opens the progress and hands over a START as the question's does. That progress returns to UPDATES when the update ends or its START was spent; the question's returns to the menu.
| bool coproc_update_older | ( | cu_version_t | running, |
| cu_version_t | carried ) |
Whether carried is older than running: the question then says so, and START still takes it after the hold.
| void coproc_update_screen_offer | ( | cu_version_t | running, |
| cu_version_t | carried ) |
Offer the update: the question view, with the version the IOmcu runs and the one this panel carries. Clears both latches.
| void coproc_update_screen_progress | ( | cu_step_t | step, |
| uint16_t | block, | ||
| uint16_t | blocks ) |
The step under way and the blocks committed of blocks.
| bool coproc_update_screen_take_cancel | ( | void | ) |
True once after CANCEL, or after the question was left another way.
| bool coproc_update_screen_take_start | ( | void | ) |
True once after START's hold completed; the view is then PROGRESS.
| cu_sec_t coproc_update_section | ( | const cu_driver_t * | d, |
| const cu_feed_t * | f, | ||
| bool | unsafe ) |
Whether UPDATES' hold may start the update now, and if not why: the first of cu_sec_t's reasons that holds. unsafe: ARMED, an arm waiting, or the supply's output on or coming. A START handed over and not yet taken (d's starts_sent against f's starts_taken) is BUSY.
The hold asks for what the question asks for: an IOmcu that runs another build (CU_CHECK_DIFFERENT; the same version number with another build is one), offered or declined, a bench that is not unsafe, the radio wholly off and no panel install. An older image is READY, as the question offers it too. One that runs the carried build is SAME: the check found nothing to send, and the link-up offers nothing either.