And a few other nice things. The bootloader now has an embedded wozmon! If you know its offset, you can jump to it from the app.
29 lines
403 B
C++
29 lines
403 B
C++
#include <cstdint>
|
|
|
|
#include "pol0.h"
|
|
|
|
struct Gpio {
|
|
volatile uint32_t data;
|
|
};
|
|
|
|
#define gpio0 ((Gpio*)GPIO0_BASE)
|
|
|
|
void sleep(int ms) {
|
|
for (int m = 0; m < ms; m++) {
|
|
for (int i = 0; i < 10000; i++) {
|
|
asm volatile ( "" );
|
|
}
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
int out = 0;
|
|
|
|
while (1) {
|
|
gpio0->data = out;
|
|
out = (out + 1) % 256;
|
|
|
|
sleep(10);
|
|
}
|
|
}
|