B
Brutus
Guest
Ho creato questo programma sotto Salvo 2,2:
# include <salvo.h>
# include <pic.h>
/ / # define TASK1_P OSTCBP (1)
/ / # define TASK2_P OSTCBP (2)
_OSLabel (TaskCount1)
_OSLabel (TaskShow1)
_OSLabel (TaskShow2)
_OSLabel (TaskCount2)
unsigned int contatore = 0;
TaskCount nullo (void)
(
/ / OSSetPrio (1, TaskShow1);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />
(
PORTA PORTA ^ = 0x01;
OS_Yield (TaskCount2);
)
)TaskShow nullo (void)
(
/ / OS_SetPrio (1, TaskCount1);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />
(
PORTB = PORTB ^ 0x01;
OS_Yield (TaskShow2);
)
)void main (void)
(
ADCON1 = 0b00000111;
Trisa = 0x00;
TRISB = 0x00;
PORTB = 0x00;
PORTA = 0x00;
/ / T0CS = 0; / /
/ / T0IE = 1; / /
/ / InitializeMultitasking ();
OSInit ();
OSCreateTask (TaskCount, OSTCBP (1), 3);
OSCreateTask (TaskShow, OSTCBP (2), 2);
/ / OSStartTask (1);
/ / OSStartTask (2);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />OSSched ();
)
il LED di Porta
doesnt lavoro perché?
non vi è alcuna commutazione fra il compito
grazie per la risposta
# include <salvo.h>
# include <pic.h>
/ / # define TASK1_P OSTCBP (1)
/ / # define TASK2_P OSTCBP (2)
_OSLabel (TaskCount1)
_OSLabel (TaskShow1)
_OSLabel (TaskShow2)
_OSLabel (TaskCount2)
unsigned int contatore = 0;
TaskCount nullo (void)
(
/ / OSSetPrio (1, TaskShow1);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />
(
PORTA PORTA ^ = 0x01;
OS_Yield (TaskCount2);
)
)TaskShow nullo (void)
(
/ / OS_SetPrio (1, TaskCount1);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />
(
PORTB = PORTB ^ 0x01;
OS_Yield (TaskShow2);
)
)void main (void)
(
ADCON1 = 0b00000111;
Trisa = 0x00;
TRISB = 0x00;
PORTB = 0x00;
PORTA = 0x00;
/ / T0CS = 0; / /
/ / T0IE = 1; / /
/ / InitializeMultitasking ();
OSInit ();
OSCreateTask (TaskCount, OSTCBP (1), 3);
OSCreateTask (TaskShow, OSTCBP (2), 2);
/ / OSStartTask (1);
/ / OSStartTask (2);
for (;
<img src="http://www.edaboard.com/images/smiles/icon_wink.gif" alt="Wink" border="0" />OSSched ();
)
il LED di Porta
doesnt lavoro perché?
non vi è alcuna commutazione fra il compito
grazie per la risposta