Comment the setup a bit

master
LEdoian 5 years ago
parent 528fd712c2
commit 58f7ce498d

@ -12,3 +12,7 @@ CPU_FLAGS := -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd
%.bin: %.elf
arm-none-eabi-objcopy -Obinary $*.elf $*.bin
flash: main.bin
st-flash write /dev/stlinkv1_4 main.bin 0x08000000
.PHONY: flash

@ -18,10 +18,18 @@
#define STM32F1 1 // Needed for libopencm3
void setup (void) { // All the blackbox code
// Set up clock
rcc_clock_setup_in_hse_8mhz_out_24mhz();
// Enable the two GPIOs
rcc_periph_clock_enable(RCC_GPIOC);
rcc_periph_clock_enable(RCC_GPIOA);
// GPIO C8 amd C9 are the two LEDs
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO8 | GPIO9);
// GPIO A0 is the push button
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO0);
}

Loading…
Cancel
Save