git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2105 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2010-07-31 12:11:35 +00:00
parent 1f7b57f575
commit 76d2dd6f45
1 changed files with 16 additions and 1 deletions

View File

@ -20,12 +20,23 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
static VirtualTimer vt;
static void restart(void *p) {
(void)p;
uartStartSend(&UARTD2, 14, "Hello World!\r\n");
}
static void txend1(void) { static void txend1(void) {
} }
static void txend2(void) { static void txend2(void) {
chSysLockFromIsr();
chVTSetI(&vt, MS2ST(1000), restart, NULL);
chSysUnlockFromIsr();
} }
static void rxerr(uartflags_t e) { static void rxerr(uartflags_t e) {
@ -89,12 +100,16 @@ int main(int argc, char **argv) {
*/ */
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
* Starts the transmission, it will be handled entirely in background.
*/
uartStartSend(&UARTD2, 13, "Starting...\r\n");
/* /*
* Normal main() thread activity, in this demo it does nothing except * Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the button state. * sleeping in a loop and check the button state.
*/ */
while (TRUE) { while (TRUE) {
uartStartSend(&UARTD2, 14, "Hello World!\r\n");
chThdSleepMilliseconds(500); chThdSleepMilliseconds(500);
} }
return 0; return 0;