#include <cstdint>

#include "hal/gpio.h"
#include "hal/pol0.h"

namespace {

Gpio* gpio0;

void sleep(int ms) {
    for (int m = 0; m < ms; m++) {
        for (int i = 0; i < 10000; i++) {
            asm volatile("");
        }
    }
}

}  // namespace

int main() {
    gpio0 = Gpio::Instance(GPIO0_BASE);
    int out = 0;

    while (1) {
        gpio0->data = out;
        out = (out + 1) % 256;

        sleep(10);
    }
}
