reset: remove old code
This commit is contained in:
parent
89605d6da0
commit
b5cdc92ba8
1 changed files with 0 additions and 44 deletions
|
@ -1,44 +0,0 @@
|
||||||
/* This is our reset code (tested).
|
|
||||||
*
|
|
||||||
* TODO: integrate fully within code base.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <libopencm3/stm32/rcc.h>
|
|
||||||
#include <libopencm3/stm32/gpio.h>
|
|
||||||
|
|
||||||
static void delay(unsigned ms)
|
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < 1000 * ms; ++i) {
|
|
||||||
__asm__("nop");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
rcc_periph_clock_enable(RCC_GPIOB);
|
|
||||||
rcc_periph_clock_enable(RCC_GPIOC);
|
|
||||||
|
|
||||||
gpio_mode_setup(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO11);
|
|
||||||
gpio_set_output_options(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_25MHZ, GPIO11);
|
|
||||||
|
|
||||||
gpio_mode_setup(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO8);
|
|
||||||
gpio_mode_setup(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO9);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
gpio_set(GPIOB, GPIO11);
|
|
||||||
gpio_clear(GPIOC, GPIO8);
|
|
||||||
gpio_set(GPIOC, GPIO9);
|
|
||||||
delay(5 * 5000);
|
|
||||||
|
|
||||||
gpio_clear(GPIOB, GPIO11);
|
|
||||||
gpio_set(GPIOC, GPIO8);
|
|
||||||
gpio_clear(GPIOC, GPIO9);
|
|
||||||
delay(5 * 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue