Commit Graph

42 Commits

Author SHA1 Message Date
Paul van Tilburg f2adba108a
Reorder the task attributes for clearity 2019-12-20 13:34:23 +01:00
Paul van Tilburg 132dfd8965
Fix the name of the EXTI control resource 2019-12-20 13:31:00 +01:00
Paul van Tilburg f11d8dfd7e
Add resource struct field documentation 2019-12-20 13:30:40 +01:00
Paul van Tilburg 3fe2d062f2
Port example to stm32f4xx-hal version 0.6
* Switch to the `embedded_hal::digital::v2::OutputPin` trait
* Handle all infallable `set_low`/`set_high` calls within the
  `led_ring` module
2019-12-20 13:16:19 +01:00
Paul van Tilburg 39e043b9e9
Port example to RTFM version 0.5
See https://rtfm.rs/0.5/book/en/migration.html for the migration guide.

Additional changes:
* Turned all resources into snake case (as they are struct fields now)
* Set up and enable the cycle counter (CYCCNT) for scheduling
2019-12-20 13:16:15 +01:00
Paul van Tilburg 8b7d68e41c
Remove the deny(warnings) attributes
It was suggested on the Rust Embedded channel to not set this in
released code.  The warnings are currently because of the embedded-hal
crate deprecating digital::v1, but stm32f4xx-hal still using it.
2019-06-29 12:08:16 +02:00
Paul van Tilburg d8e135d245
Capitalize the resource names for consistency
Since the resources are implemented via static mut's, it make sense
stylewise to capitalize them.
2019-06-24 22:32:40 +02:00
Paul van Tilburg 6e8de672ea
Move the led_ring module to a local crate
The library will allow for the tests to be actually run.
If we try to run the tests through the main binary this fails
due to missing a eh_personality language item.
2019-04-11 20:09:43 +02:00
Paul van Tilburg 2e23acb335
Fix the unit tests for the led_ring module
This requires the LedRing to provide access to its LEDs.
Make those available and prevent testing against some copy/clone
of the initial mock LEDs.
2019-04-11 20:07:40 +02:00
Paul van Tilburg 2da5ca7117
Run cargo fmt 2019-04-06 23:30:15 +02:00
Paul van Tilburg cf5238f4f4
Add (non-functional) tests for the `led_ring` module 2019-04-06 17:47:58 +02:00
Paul van Tilburg b0dae59274
Add methods to inspect LED ring mode and direction 2019-04-06 17:43:21 +02:00
Paul van Tilburg 3730032ee6
Make the `led_ring` module work with output pins
This ensures that we can test the module by replacing real (board)
output pins by mock ones and test the module.
2019-04-06 17:38:03 +02:00
Paul van Tilburg 80fabf85e8
Move the Led struct and PERIOD const to main module
These definitions are board-specific and do not belong in the more
generic `led_ring` module.
2019-04-06 17:36:17 +02:00
Paul van Tilburg 8e31b2c27d
Do not use panic_semihosting during tests 2019-04-06 13:01:20 +02:00
Paul van Tilburg 7fef19d2fb
Rename the set_directions method on LedRing
This hopefully prevens confusion between "compass directions" and
LED ring cycle direction.
2019-04-06 12:01:49 +02:00
Paul van Tilburg 18061e094e CLean up Cargo.toml and the code a bit (more 2018 editionish) 2019-03-20 10:30:57 +01:00
Paul van Tilburg 1fff7f634f Add documentation; tiny code refactoring 2019-03-17 14:19:52 +01:00
Paul van Tilburg 88793567c2 Run cargo fmt 2019-03-17 13:36:52 +01:00
Paul van Tilburg 7b9ee69d1a Rename the led module to led_ring 2019-03-15 23:30:04 +01:00
Paul van Tilburg d191072a3c Add accelerometer support 2019-03-15 22:22:20 +01:00
Paul van Tilburg bdd1e869c7 Output to the serial interface that initialisation is finished 2019-03-15 22:18:18 +01:00
Paul van Tilburg ad809e2bc4 Rename switch_leds to cycle_leds; only spawn on init when needed 2019-03-15 22:11:27 +01:00
Paul van Tilburg 6ab8d98180 Refactor the LedCycle struct, impl and related enums 2019-03-15 22:08:15 +01:00
Paul van Tilburg 27fe066219 Handle backspace in the serial interface 2019-03-15 15:12:28 +01:00
Paul van Tilburg 84325d9434 Comment tweak 2019-03-12 17:27:47 +01:00
Paul van Tilburg 4c87af1991 Serial write actions should be blocking 2019-03-12 17:27:38 +01:00
Paul van Tilburg eb9faa7593 Serial interface output tweaks 2019-03-12 16:44:59 +01:00
Paul van Tilburg 5c80e05263 Switch to USART2 so that serial communication actually works 2019-03-12 16:44:42 +01:00
Paul van Tilburg e5b6a81841 Write button events to the serial port 2019-03-12 15:47:40 +01:00
Paul van Tilburg 07c4a3ccc6 Fix typos 2019-03-07 23:05:17 +01:00
Paul van Tilburg 9caf68f25a Split off all the led stuff into a separate module 2019-03-07 23:03:41 +01:00
Paul van Tilburg 6ce7d70613 Introduce a serial command interface via USART1 2019-03-07 22:41:59 +01:00
Paul van Tilburg be76045635 Introduce the LedCycle struct to bundle a lot of led cycle functionality 2019-03-07 22:40:41 +01:00
Paul van Tilburg e7d28453f9 Use TIM2 as the timer interrupt (for the switch_leds task) 2019-03-06 23:14:39 +01:00
Paul van Tilburg b403ea00e0 Use hal::stm32::EXTI so it is directly available 2019-03-06 23:14:10 +01:00
Paul van Tilburg c2f159b63f Add a flip() helper method for LedDirection; use it 2019-03-06 23:03:06 +01:00
Paul van Tilburg c7f6c19e75 Add a UserButton type alias 2019-03-06 23:02:05 +01:00
Paul van Tilburg d0216915c2 Add an interrupt to the user button; reverse LED cycle direction 2019-03-06 21:16:05 +01:00
Paul van Tilburg 283655e30e Just spawn switch_leds task; drop unused crate 2019-03-05 17:03:46 +01:00
Paul van Tilburg 66aff9a87d The rtfm example becomes the new main binary 2019-03-05 15:06:10 +01:00
Paul van Tilburg ff21e58323 Initial import into Git 2019-03-05 15:04:26 +01:00