Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose channel monitoring and telemetry as RTIC tasks #32

Merged
merged 16 commits into from
Aug 24, 2020

Conversation

ryan-summers
Copy link
Member

This PR closes #5 by exposing the channel management interface as two RTIC tasks. Namely, there is a telemetry task and a monitor task.

The monitor task runs at 50Hz and detects errors/warnings/enabled state of the channel to propagate the user interface LEDs.

The telemetry task runs at 2Hz to report detailed channel measurements over a telemetry interface for reporting.

Currently, the scheduling is accomplished using hardware timers. We could go for RTIC monotonic implementation to use a single timer resource in the future, but I figured it was fine to use the timer interrupts for now.

@jordens
Copy link
Member

jordens commented Jul 21, 2020

  • HW timers are certainly fine for now. But ultimately with the other timer based operations (like the MQTT state machine, networking), it needs to be the RTIC timer queue.
  • The description of the fast task should probably "things we need to react to relatively quickly": buttons, interlock/alarm detection, and global veto (PGOOD etc)

@ryan-summers
Copy link
Member Author

I've updated this to use the RTIC CYCCNT. We can replace the scheduler with our own monotonic in the future, such as something from embedded-time.

I dislike the current implementation because it relies on a hard-coded constant CPU clock and doesn't allow the device to enter low power states when the clock is not in use.

I've also updated this branch to use an alpha release of shared-bus, which adds a lot more flexibility to shared-bus.


[dependencies.stm32f4xx-hal]
version = "0.8.3"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using our own fork beause I've made a number of ADC and I2C related patches that are required for our operation. Most are merged in to the stm32f4xx-hal mainline, but there's some that aren't quite there yet.

@ryan-summers ryan-summers merged commit 0f3f277 into develop Aug 24, 2020
@ryan-summers ryan-summers deleted the feature/rtic-tasks branch August 24, 2020 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop control interface for booster RF channels
2 participants