diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2024-09-12 12:10:26 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2024-09-12 12:10:26 +0800 |
| commit | 5c22c9d91a4dcc05b29144a51d03cd31ae4f285a (patch) | |
| tree | 641956b5e4945e283d390ab48a4e5712e187324b | |
| parent | a4499b0ceab85cdd028e11d191bd5456f10ed074 (diff) | |
| download | bare-metal-arduino-due-5c22c9d91a4dcc05b29144a51d03cd31ae4f285a.tar.gz | |
Blink working.
| -rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -8,6 +8,7 @@ #define PIO_PER *((volatile unsigned int *)(PORT + 0x0000u)) #define PIO_OER *((volatile unsigned int *)(PORT + 0x0010u)) #define PIO_SODR *((volatile unsigned int *)(PORT + 0x0030u)) +#define PIO_CODR *((volatile unsigned int *)(PORT + 0x0034u)) #define PIO_PUDR *((volatile unsigned int *)(PORT + 0x0060u)) #define PIO_WPMR *((volatile unsigned int *)(PORT + 0x00E4u)) @@ -33,10 +34,12 @@ int main(void) PIO_WPMR = (PIO_WPKEY << 8) | 1u; for (;;) { + PIO_SODR |= GPIO_MASK; + for (i = 0; i < 0x100000; i++) + ; + PIO_CODR |= GPIO_MASK; for (i = 0; i < 0x100000; i++) ; - - PIO_SODR ^= GPIO_MASK; } return 0; |
