Why isn't it possible to use the Soft_i2c-library in an interrupt? I get "Reentrancy not allowed: function [Soft_I2C_Write] called in both main and interrupt threads", as an error message.
And the bonus questions!
1. I want something like this:
Code: Select all
void stuff_returned(char j) {
result = 'do something with j';
}
.
.
.
result = stuff_returned(a);
2. Also, there seem to be some trouble with lcd-library:
Code: Select all
// PIC16F877A 20MHz
program lcd_test
main:
TRISD = 0
Lcd_Config(PORTD,2,3,1,4,5,7,6)
Lcd_Cmd(Lcd_Clear)
Lcd_Cmd(Lcd_CURSOR_OFF)
Lcd_out(1, 1, "B!")
End.
That mBasic code works fine, but this, in mC, doesn't;
Code: Select all
// PIC16F877A 20MHz
void main() {
TRISD = 0x00;
Lcd_Config(&PORTD,2,3,1,4,5,7,6);
Lcd_Cmd(Lcd_Clear);
Lcd_Cmd(Lcd_CURSOR_OFF);
lcd_out(1, 1, "C!");
}//!
Thanks.