git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@46 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
9229005c5d
commit
6264592246
|
@ -77,7 +77,7 @@ TSRC =
|
|||
ASMSRC = crt0.s chcore2.s
|
||||
|
||||
# List all user directories here
|
||||
UINCDIR = ../../src/include ../../ports/ARM7-LPC214x/GCC
|
||||
UINCDIR = ../../src/include ../../src/lib ../../ports/ARM7-LPC214x/GCC
|
||||
|
||||
# List the user directory to look for the libraries here
|
||||
ULIBDIR =
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "lpc214x.h"
|
||||
#include "lpc214x_serial.h"
|
||||
#include "buzzer.h"
|
||||
#include "evtimer.h"
|
||||
|
||||
static BYTE8 waThread1[UserStackSize(32)];
|
||||
|
||||
|
@ -53,13 +54,11 @@ static t_msg Thread2(void *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static BYTE8 waThread3[UserStackSize(64)];
|
||||
static void TimerHandler(t_eventid id) {
|
||||
|
||||
static t_msg Thread3(void *arg) {
|
||||
t_msg TestThread(void *p);
|
||||
|
||||
while (TRUE) {
|
||||
if (!(IO0PIN & 0x00018000)) {
|
||||
if (!(IO0PIN & 0x00018000)) { // Both buttons
|
||||
TestThread(&COM1);
|
||||
PlaySound(500, 100);
|
||||
}
|
||||
|
@ -69,8 +68,22 @@ static t_msg Thread3(void *arg) {
|
|||
if (!(IO0PIN & 0x00010000)) // Button 2
|
||||
chFDDWrite(&COM1, (BYTE8 *)"Hello World!\r\n", 14);
|
||||
}
|
||||
chThdSleep(500);
|
||||
}
|
||||
|
||||
static BYTE8 waThread3[UserStackSize(64)];
|
||||
static EvTimer evt;
|
||||
static t_evhandler evhndl[1] = {
|
||||
TimerHandler
|
||||
};
|
||||
|
||||
static t_msg Thread3(void *arg) {
|
||||
struct EventListener el;
|
||||
|
||||
evtInit(&evt, 500);
|
||||
evtRegister(&evt, &el, 0);
|
||||
evtStart(&evt);
|
||||
while (TRUE)
|
||||
chEvtWait(ALL_EVENTS, evhndl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ AVR-AT90CANx-GCC - Port on AVER AT90CAN128, not complete yet.
|
|||
main() procedure are performed before any thread starts.
|
||||
- Added chThdSetPriority() new API.
|
||||
- Added a generic events generator timer to the library code.
|
||||
- Modified the ARM7-LPC214x-GCC demo to show the use of the event timer.
|
||||
- Added the "#ifdef __cplusplus" stuff to the header files.
|
||||
- Removed an obsolete definition in ./src/templates/chtypes.h.
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
static void tmrcb(void *p) {
|
||||
EvTimer *etp = p;
|
||||
|
||||
chEvtSendI(&etp->et_es);
|
||||
chVTSetI(&etp->et_vt, etp->et_interval, tmrcb, etp);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ extern "C" {
|
|||
/**
|
||||
* Initializes an \p EvTimer structure.
|
||||
*/
|
||||
#define evtInit(et, i) (chEvtInit(&(etp)->et_es), \
|
||||
#define evtInit(etp, i) (chEvtInit(&(etp)->et_es), \
|
||||
(etp)->et_vt.vt_func = NULL, \
|
||||
(etp)->et_interval = (i))
|
||||
|
||||
|
|
Loading…
Reference in New Issue