sandbox/blue-pill/draugr/blink.cc

23 lines
480 B
C++
Raw Normal View History

2018-03-07 16:06:25 +00:00
#include "bluepill.h"
2018-03-07 23:55:54 +00:00
constexpr uint32_t LED = 13;
constexpr unsigned long SDELAY = 100000;
constexpr unsigned long LDELAY = (SDELAY * 10) - (3 * SDELAY);
2018-03-07 16:06:25 +00:00
int
main() {
GPIO_C->enable_clock();
2018-03-07 23:55:54 +00:00
GPIO_C->pin_mode(LED, true, OUTPUT_GPP, OUTPUT_MAX_2MHZ);
2018-03-07 16:06:25 +00:00
2018-03-08 19:31:00 +00:00
while (true) {
2018-03-07 23:55:54 +00:00
GPIO_C->pin_clear(LED);
delay(LDELAY);
GPIO_C->pin_set(LED);
delay(SDELAY);
GPIO_C->pin_clear(LED);
delay(SDELAY);
GPIO_C->pin_set(LED);
delay(SDELAY);
2018-03-07 16:06:25 +00:00
}
}