Commit Graph

50 Commits

Author SHA1 Message Date
Paul van Tilburg ac8030aa4f
Improve the README a bit more 2019-04-11 20:21:59 +02:00
Paul van Tilburg ebeb18e8d8
Enable running unit tests in GitLab CI
Do this for the library/local crate only.  Not the main binary nor
the examples can be tested for the x86_64-unknown-linux-gnu target.
2019-04-11 20:10:49 +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 6aab250e73
Also run tests during the build phase (for now)
Set an option for running doctests so that they can be run without
the "`eh_personality` language item not found" popping up.
See also: https://github.com/rust-lang/cargo/issues/4251
2019-04-03 08:38:00 +02:00
Paul van Tilburg de70a03c11
Cache the Cargo dir and build artifacts 2019-04-02 16:11:43 +02:00
Paul van Tilburg 6528da79db
Remove unused example stuff from the Cargo config 2019-04-02 16:09:35 +02:00
Paul van Tilburg eeb611983a Add the thumbv7em-none-eabihf target for Rust 2019-04-02 15:48:13 +02:00
Paul van Tilburg 51328a5378 Improve the README 2019-04-02 15:47:57 +02:00
Paul van Tilburg 706419b71b Use the arm32v7 Rust Docker image for CI 2019-04-02 12:41:25 +02:00
Paul van Tilburg f1452aa884 Add GitLab CI 2019-04-02 12:28:26 +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 85317dcbd6 Add license and readme files 2019-03-19 08:52:48 +01:00
Paul van Tilburg e496e29e09 Rename the crate (and bin) to stm32f4disc-demo
Do this to make explicit it works just for the STM32F4DISCOVERY board.
2019-03-17 14:22:27 +01:00
Paul van Tilburg 1fff7f634f Add documentation; tiny code refactoring 2019-03-17 14:19:52 +01:00
Paul van Tilburg a49a04e06f Add basic examples 2019-03-17 13:38:36 +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 a795bf910f Clean up Cargo.toml a bit 2019-03-15 22:27:22 +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 cbc0b0c93a Rename the package (and application) to stm32f4-demo 2019-03-06 21:18:10 +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 3e5088edfa Rework the rftm example to do the same as main 2019-03-05 15:05:15 +01:00
Paul van Tilburg ff21e58323 Initial import into Git 2019-03-05 15:04:26 +01:00