(1) (OLPLQDFLyQ GH HVWUXFWXUDV GH VLQFURQL]DFLyQ (2

Anuncio
(1) (OLPLQDFLyQGHHVWUXFWXUDVGHVLQFURQL]DFLyQ
260ER['HO
264'HO (OS_EVENT *pevent,
266HP'HO INT8U opt,
26B'(/B12B3(1'
VyORVLQRWDUHDVSHQGLHQWHV
26B'(/B$/:$<6
VLHPSUHWDUHDVSHQGLHQWHV
VRQGHVEORTXHDGDV
INT8U *err)
(2) ([WHQVLyQGH260ER[3RVW
INT8U 260ER[3RVW2SW(
OS_EVENT *mbox,
void *msg,
INT8U opt)
26B3267B237B121(FRPR260ER[3RVW
26B3267B237B%52$'&$67
HOPHQVDMHHVHQYLDGRDWRGDVODV
WDUHDVTXHHVSHUDQHQHOPDLOER[
(3) ([WHQVLyQGH2643RVW
INT8U 2643RVW2SW(
OS_EVENT *queue,
void *msg,
INT8U opt)
26B3267B237B121(FRPR2643RVW
26B3267B237B)5217FRPR2643RVW)URQW
26B3267B237B%52$'&$67HOPHQVDMH
HVHQYLDGRDWRGDVODVWDUHDVTXH
HVSHUDQHQODFROD
(4) 6LQFURQL]DFLyQFRQHYHQWRVDSHULyGLFRV)/$*6
Enteros de 8 / 16 / 32 bits – ver tipo OS_FLAGS en OS_CFG.H
OS_FLAG_GRP *26)ODJ&UHDWH(
OS_FLAGS flags,
INT8U *err)
OS_FLAG_GRP *26)ODJ'HO(
OS_FLAG_GRP *flag,
INT8U opt,
YDORULQLFLDO
26B'(/B12B3(1'
26B'(/B$/:$<6
INT8U *err)
OS_FLAGS 26)ODJ3RVW(
OS_FLAG_GRP *flag,
OS_FLAGS flags,
INT8U opt,
PiVFDUDIODJV DFWLYRV
26B)/$*6B6(7
26B)/$*6B&/5
INT8U *err)
OS_FLAGS 26)ODJ3HQG(
OS_FLAG_GRP *flag,
OS_FLAGS flags,
INT8U wait_type,
INT8U *err)
OS_FLAGS 26)ODJ4XHU\(
OS_FLAG_GRP *flag,
INT8U *err)
PiVFDUDIODJV DFWLYRV
26B)/$*B:$,7B&/5B$//
26B)/$*B:$,7B&/5B$1<
26B)/$*B:$,7B6(7B$//
26B)/$*B:$,7B6(7B$1<
26B)/$*B&21680(
OS_FLAG_GRP *EngineStatus;
#define ENGINE_OIL_PRESS_OK
#define ENGINE_OIL_TEMP_OK
#define ENGINE_START
0x01
0x02
0x04
void main (void)
{
INT8U err;
…
EngineStatus = OSFlagCreate(0x00,&err);
…
OSStart();
}
void task1 (void *pdata)
{
INT8U err;
OS_FLAGS value;
…
for(;;) {
value = OSFlagPend(EngineStatus,
ENGINE_OIL_PRESS_OK + ENGINE_OIL_TEMP_OK,
OS_FLAG_WAIT_SET_ALL + OS_FLAG_CONSUME,
10, &err);
if (err == OS_TIMEOUT) {…}
…
}
}
void interrupt ISR1 (void)
{
…
OSFlagPost (EngineStatus, ENGINE_OIL_PRESS_OK,
OS_FLAG_SET, &err);
…
}
void interrupt ISR2 (void)
{
…
OSFlagPost (EngineStatus, ENGINE_OIL_TEMP_OK,
OS_FLAG_SET, &err);
…
}
(5) ([FOXVLYLGDGPXWXDFRQKHUHQFLDGHSULRULGDGHV087(;
OS_EVENT *260XWH[&UHDWH(
INT8U prio,
SULRULGDGTXHDGTXLHUHOD
WDUHDHOHQWUDUHQOD5&
VXSHULRUDWRGDVODVWDUHDV
TXHXVDQHOPXWH[ \QRFRLQFLGLU
FRQQLQJXQDRWUDWDUHD
INT8U *err)
OS_EVENT *260XWH['HO(
OS_EVENT *mutex,
INT8U opt,
26B'(/B12B3(1'
26B'(/B$/:$<6
INT8U *err)
void 260XWH[3HQG(
OS_EVENT *mutex,
INT16U timeout,
INT8U *err)
Es conveniente no retrasar ni suspender una tarea
que adquiere un mutex !!
INT8U 260XWH[$FFHSW(
OS_EVENT *mutex,
INT8U *err)
Retorna 1 si MUTEX libre y 0 si lo tiene otra tarea
INT8U 260XWH[3RVW(OS_EVENT *mutex)
Descargar