Commit fd9a459f authored by Erik Strand's avatar Erik Strand
Browse files

Fix the blinking

parent efd173d6
......@@ -2,17 +2,25 @@
int main (void) {
int i;
REG_PORT_DIR0 |= (1<<17);
REG_PORT_DIR0 |= (1<<19);
// red led is 17, green led is 19
REG_PORT_DIR0 = (1u << 17) | (1u << 19);
// green led
//REG_PORT_DIR0 |= (1u<<19);
//REG_PORT_OUTCLR0 = (1u << 19);
//REG_PORT_OUTSET0 = (1u << 17);
while(1) {
REG_PORT_OUTSET0 |= (1<<17);
REG_PORT_OUTCLR0 |= (1<<19);
for (i=0;i<10000;i++) {
REG_PORT_OUTSET0 = (1u << 17);
REG_PORT_OUTCLR0 = (1u << 19);
for (i=0; i<1000000; i++) {
__asm("nop");
}
REG_PORT_OUTCLR0 |= (1<<17);
REG_PORT_OUTSET0 |= (1<<19);
for (i=0;i<10000;i++) {
REG_PORT_OUTCLR0 = (1u << 17);
REG_PORT_OUTSET0 = (1u << 19);
for (i=0; i<1000000; i++) {
__asm("nop");
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment