icicle/progmem.c

21 lines
442 B
C
Raw Normal View History

2017-12-15 20:08:55 +00:00
#include <stdint.h>
#define LEDS *((volatile uint32_t *) 0x00010000)
#define UART_BAUD *((volatile uint32_t *) 0x00020000)
#define UART_STATUS *((volatile uint32_t *) 0x00020004)
#define UART_DATA *((volatile int32_t *) 0x00020008)
int main() {
UART_BAUD = 36000000 / 9600;
for (;;) {
int32_t c;
do {
c = UART_DATA;
} while (c < 0);
UART_DATA = c;
LEDS = c;
}
}