Hello.
I find strange compiler issue.
[code:1:d67b780634]
$regfile = "m1284Pdef.dat"
$crystal = 20000000
$hwstack = 70
$swstack = 70
$framesize = 100
$lib "key_i2c.lib" ' i2c Keyboard driver
$external _key_scan 'Enable the routine
Config Pinb.2 = Input
Set Portb.2
Const Pcf8574_kbd = &H42 'Defines the address of the I/O expander for KBD
Config I2cdelay = 10
Config Scl = Portc.4 'Configure i2c SCL
Config Sda = Portc.5 'Configure i2c SDA
I2cinit
!call _Key_Init 'Call initialization routine (needed if int. driven)
Dim _bkey_scan As Byte , A As Byte 'Returned Key from _Key_scan
Enable Interrupts
Config Int2 = Falling 'Int signal from PCF8574_KBD is connected to INT1
Enable Int2
On Int2 _int2_label 'Procedure to call upon interrupt
Do
' Waitms 50
'Now I could accept input from Keyboard
If _bkey_scan > 0 Then 'As the keyboard is interupt driven I could do like this!
Disable Int2 'Disable Int1 during LCD output due to the fact
Print _bkey_scan ;
Enable Int2
End If
Loop
End
_int2_label:
!call _Key_Scan
Return
[/code:1:d67b780634]
If you try to compile you will get error "Error : 61 Line : 50 Label not found [_WAITMS ] ......
If you put Waitms command in the code (I add after Do) - you will get right result.
Issue exist with key_i2c.lib and compiled key_i2c.lbx lib.
Here 2.0.7.7 version.
Regards.
↧