diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-24 13:46:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-24 13:46:41 -0700 |
commit | 93b063fedfcf7409a67df035170ea5670cad22e1 (patch) | |
tree | a23321a7465d966b1ccf196ca00e65a70c9f9110 /01-system-clock/src/main.c | |
parent | b040195d31df6ad759f16ea3456471897f55daa1 (diff) | |
download | stm32l4-93b063fedfcf7409a67df035170ea5670cad22e1.tar.gz stm32l4-93b063fedfcf7409a67df035170ea5670cad22e1.tar.bz2 stm32l4-93b063fedfcf7409a67df035170ea5670cad22e1.zip |
Moved action to top level.
Removed old iterations of the project and moved the files from 02-usart
to the root directory since that's the sole place where the action is
and that subproject has outgrown its initial title.
Diffstat (limited to '01-system-clock/src/main.c')
-rw-r--r-- | 01-system-clock/src/main.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/01-system-clock/src/main.c b/01-system-clock/src/main.c deleted file mode 100644 index 7912bf2..0000000 --- a/01-system-clock/src/main.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "clock.h" -#include "delay.h" -#include "gpio.h" -#include "spin.h" - -volatile uint32_t delay_amt = 20000000 / 4; - -/* Main function. This gets executed from the interrupt vector defined above. */ -int main() -{ - /* Enable the GPIO port B. */ - - __IO gpio_port_t* port_b = enable_gpio(GPIO_PORT_B); - gpio_output_pin_t pin3 = set_gpio_pin_output(port_b, PIN_3); - gpio_output_pin_t pin1 = set_gpio_pin_output(port_b, PIN_1); - - /* Enable a higher clock frequency. */ - set_system_clock_MHz(80); - - uint32_t count = 0; - while (1) { - /* Set the GPIO pin to high. */ - pin_off(pin1); - pin_off(pin3); - delay(delay_amt); - - /* Set the GPIO pin to low. */ - if (count % 4 == 0) { - pin_on(pin1); - } - pin_on(pin3); - delay(delay_amt); - - ++count; - } -} |