git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@511 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
ae97c97b11
commit
554e9da84a
|
@ -28,9 +28,9 @@ static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
|
AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
|
||||||
chThdSleep(100);
|
chThdSleepMilliseconds(100);
|
||||||
AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // LCD off.
|
AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // LCD off.
|
||||||
chThdSleep(900);
|
chThdSleepMilliseconds(900);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ int main(int argc, char **argv) {
|
||||||
* Normal main() thread activity.
|
* Normal main() thread activity.
|
||||||
*/
|
*/
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
chThdSleep(500);
|
chThdSleepMilliseconds(500);
|
||||||
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW1))
|
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW1))
|
||||||
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
|
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
|
||||||
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW2))
|
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW2))
|
||||||
|
|
|
@ -33,9 +33,9 @@ static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
|
AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
|
||||||
chThdSleep(100);
|
chThdSleepMilliseconds(100);
|
||||||
AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // LCD off.
|
AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // LCD off.
|
||||||
chThdSleep(900);
|
chThdSleepMilliseconds(900);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ int main(int argc, char **argv) {
|
||||||
* Normal main() thread activity.
|
* Normal main() thread activity.
|
||||||
*/
|
*/
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
chThdSleep(500);
|
chThdSleepMilliseconds(500);
|
||||||
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW1))
|
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW1))
|
||||||
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
|
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
|
||||||
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW2))
|
if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW2))
|
||||||
|
|
|
@ -29,13 +29,13 @@ static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
IO0CLR = 0x00000800;
|
IO0CLR = 0x00000800;
|
||||||
chThdSleep(200);
|
chThdSleepMilliseconds(200);
|
||||||
IO0SET = 0x00000C00;
|
IO0SET = 0x00000C00;
|
||||||
chThdSleep(800);
|
chThdSleepMilliseconds(800);
|
||||||
IO0CLR = 0x00000400;
|
IO0CLR = 0x00000400;
|
||||||
chThdSleep(200);
|
chThdSleepMilliseconds(200);
|
||||||
IO0SET = 0x00000C00;
|
IO0SET = 0x00000C00;
|
||||||
chThdSleep(800);
|
chThdSleepMilliseconds(800);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,9 @@ static msg_t Thread2(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
IO0CLR = 0x80000000;
|
IO0CLR = 0x80000000;
|
||||||
chThdSleep(200);
|
chThdSleepMilliseconds(200);
|
||||||
IO0SET = 0x80000000;
|
IO0SET = 0x80000000;
|
||||||
chThdSleep(300);
|
chThdSleepMilliseconds(300);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,6 @@ int main(int argc, char **argv) {
|
||||||
* sleeping in a loop.
|
* sleeping in a loop.
|
||||||
*/
|
*/
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
chThdSleep(1000);
|
chThdSleepMilliseconds(1000);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
PORTE ^= PORTE_LED;
|
PORTE ^= PORTE_LED;
|
||||||
chThdSleep(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ int main(int argc, char **argv) {
|
||||||
/*
|
/*
|
||||||
* Event Timer initialization.
|
* Event Timer initialization.
|
||||||
*/
|
*/
|
||||||
evtInit(&evt, 500); /* Initializes an event timer object. */
|
evtInit(&evt, MS2ST(500)); /* Initializes an event timer object. */
|
||||||
evtStart(&evt); /* Starts the event timer. */
|
evtStart(&evt); /* Starts the event timer. */
|
||||||
chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
|
chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ int main(int argc, char **argv) {
|
||||||
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
|
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
|
||||||
|
|
||||||
while(TRUE)
|
while(TRUE)
|
||||||
chEvtWait(ALL_EVENTS, handlers);
|
chEvtDispatch(handlers, chEvtWaitOne(ALL_EVENTS));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ static msg_t Thread1(void *arg) {
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (!(PINA & PORTA_BUTTON2))
|
if (!(PINA & PORTA_BUTTON2))
|
||||||
PORTA ^= PORTA_RELAY;
|
PORTA ^= PORTA_RELAY;
|
||||||
chThdSleep(1000);
|
chThdSleepMilliseconds(1000);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ int main(int argc, char **argv) {
|
||||||
/*
|
/*
|
||||||
* Event Timer initialization.
|
* Event Timer initialization.
|
||||||
*/
|
*/
|
||||||
evtInit(&evt, 500); /* Initializes an event timer object. */
|
evtInit(&evt, MS2ST(500)); /* Initializes an event timer object. */
|
||||||
evtStart(&evt); /* Starts the event timer. */
|
evtStart(&evt); /* Starts the event timer. */
|
||||||
chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
|
chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ int main(int argc, char **argv) {
|
||||||
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
|
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
|
||||||
|
|
||||||
while(TRUE)
|
while(TRUE)
|
||||||
chEvtWait(ALL_EVENTS, handlers);
|
chEvtDispatch(handlers, chEvtWaitOne(ALL_EVENTS));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@ static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
P6OUT |= P6_O_LED;
|
P6OUT |= P6_O_LED;
|
||||||
chThdSleep(MS2ST(500));
|
chThdSleepMilliseconds(500);
|
||||||
P6OUT &= ~P6_O_LED;
|
P6OUT &= ~P6_O_LED;
|
||||||
chThdSleep(MS2ST(500));
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ int main(int argc, char **argv) {
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (!(P6IN & P6_I_BUTTON))
|
if (!(P6IN & P6_I_BUTTON))
|
||||||
TestThread(&COM1);
|
TestThread(&COM1);
|
||||||
chThdSleep(MS2ST(500));
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue