blue-pill: more draugr cleanups
This commit is contained in:
@@ -33,7 +33,7 @@ all: $(BIN)
|
||||
|
||||
$(ELF): $(OBJS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
||||
$(ARMSIZE) -A $@
|
||||
$(ARMSIZE) $@
|
||||
|
||||
$(BIN): $(ELF)
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
#include "bluepill.h"
|
||||
|
||||
#define LED_PIN 13
|
||||
constexpr uint32_t LED = 13;
|
||||
constexpr unsigned long SDELAY = 100000;
|
||||
constexpr unsigned long LDELAY = (SDELAY * 10) - (3 * SDELAY);
|
||||
|
||||
// void __attribute__ ((weak, naked)) reset_handler(void) {
|
||||
int
|
||||
main() {
|
||||
GPIO_C->enable_clock();
|
||||
GPIO_C->pin_mode(LED_PIN, true, OUTPUT_GPP, OUTPUT_MAX_2MHZ);
|
||||
GPIO_C->pin_mode(LED, true, OUTPUT_GPP, OUTPUT_MAX_2MHZ);
|
||||
|
||||
while(1) {
|
||||
GPIO_C->pin_clear(LED_PIN);
|
||||
delay(1000000);
|
||||
GPIO_C->pin_set(LED_PIN);
|
||||
delay(100000);
|
||||
GPIO_C->pin_clear(LED_PIN);
|
||||
delay(100000);
|
||||
GPIO_C->pin_set(LED_PIN);
|
||||
delay(100000);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
.globl vectors
|
||||
vectors:
|
||||
.align 2
|
||||
.long 0x100 /* best guess at stack pointer */
|
||||
.long reset_handler /* reset handler */
|
||||
@@ -20,7 +21,7 @@
|
||||
.skip 4 /* reserved */
|
||||
.long 0 /* pendsv handler */
|
||||
.long 0 /* systick handler */
|
||||
.skip 0x110 /* remaining / IRQ vectors */
|
||||
.skip 0xf4 /* remaining / IRQ vectors */
|
||||
|
||||
.globl reset_handler
|
||||
reset_handler:
|
||||
|
||||
Reference in New Issue
Block a user