|
Есть код. Не компиляется. Скажите пожалуйста, какие настройки нужно прописать в salvocfg.h, чтоб закампилялся.
Вот ошибка - Error[000] D:\home\projects\slp800aa.lib(binsem.obj) 13 : signatures do not match: _OSWaitBinSem (D:\home\projects\slp800aa.lib: binsem.obj): 0x1069/0x2069
Error[000] : function _OSCreateBinSem is not called from specified interrupt level
Error[000] : function _OSReturnBinSem is not called from specified interrupt level
BUILD FAILED
#define BAUD 9600 #define DIVIDER 64 #if NINE == 1 #if HIGH_SPEED == 1 /* Serial initialization */ char rc; _OSLabel(tl1); #define rs232Rc OSECBP(1) void task1(void) { void task2(void) { void task3(void) { void OSIdleTaskHook( void ) { void main(void) { ADCON1 = 7; init_comms(); SYNC = 0; TMR0IE = 0; T0CON = 0b11000111; TXEN = 1; TMR0 = 0; OSInit(); OSCreateBinSem(rs232Rc, 0); OSCreateTask(task1, OSTCBP(1), 5); for (;;) {
E-mail:
info@telesys.ru
#include "salvo.h"
//#include
#define FOSC 40000000L
#define NINE 0 /* Use 9bit communication? FALSE=8bit */
#define OUTPUT 0
#define INPUT 1
#define HIGH_SPEED 0
#define NINE_BITS 0x40
#else
#define NINE_BITS 0
#endif
#define SPEED 0x4
#else
#define SPEED 0
#endif
#define init_comms() \
{ \
SPBRG = DIVIDER; \
TXSTA = (SPEED|NINE_BITS|0x20); \
RCSTA = (NINE_BITS|0x90); \
}
char tx;
char counter;
_OSLabel(tl2);
_OSLabel(tl3);
for(;;) {
OS_Delay(200, tl1);
TXREG = '*';
}
}
for(;;) {
OS_Yield(tl2);
}
}
for(;;) {
OS_WaitBinSem(rs232Rc, OSNO_TIMEOUT, tl3);
if (++counter > 9) {
counter = 0;
}
tx = rc;
// GIE = 0;
TXIE = 1;
// GIE = 1;
}
}
}
TRISC = 0b10100111;
TRISE = 0;
LATE = 1;
PORTC = 0xFF;
SPEN = 1;
TMR0IF = 0;
IPEN = 0;
PEIE = 1;
TXIE = 0;
RCIE = 1;
CREN = 1;
SSPEN = 0;
TMR0IF = 0;
TMR0IE = 1;
OSCreateTask(task2, OSTCBP(2), 10);
OSCreateTask(task3, OSTCBP(3), 3);
GIE = 1;
OSSched();
}
}
#pragma interrupt_level 0
interrupt void intr(void){
if (TXIF == 1 && TXIE == 1){
TXREG = rc;
TXIE = 0;
RC4 ^= 1;
}
if (RCIF == 1 && RCIE == 1){
RC4 ^= 1;
rc = RCREG;
OSSignalBinSem(rs232Rc);
}
if (TMR0IF == 1 && TMR0IE == 1){
TMR0IF = 0;
OSTimer();
RC3 ^= 1;
}
}
Ответы