Kiedy omijam konfiguracje avr dos przerwanie obsługiwane jest poprawne jednak kiedy już je dodam to nie. Sprawdziłem program wychodzi z podprogramu i poprawnie wpada do pętli.
Co jest zle?
Kod: Zaznacz cały
Filemanager
sei
Config Int0 = Falling
Enable Int0
On Int0 Int_sw
Do
Waitms 10
Loop
End
Int_sw:
Ddrd.7 = 1
Toggle Portd.7
Return
Sub Filemanager
Lcdgoxy 0 , 12
Lcdstr ".:uSD_MANAGER:." , 2 , 0
Config Clock = Soft
Enable Interrupts
Config Date = Mdy , Separator = .
Lcdgoxy 1 , 0
Lcdstr "uSD:Init..." , 0 , 0
Reinit:
Ddrb.3 = 1 'kierunek portu ON/OFF uSD
Portb.3 = 0 'zeruj
Waitms 100 'czekaj
Portb.3 = 1 'włącz
Lcdgoxy 2 , 0
Lcdstr "uSD:" , 0 , 0
Waitms 500
$include "Config_MMC.bas"
If Gbdriveerror = 0 Then
Lcdstr "OK" , 0 , 0
Waitms 500
Lcdgoxy 3 , 0
Lcdstr "FAT32:Init..." , 0 , 0
Waitms 500
Lcdgoxy 4 , 0
Lcdstr "FAT32:" , 0 , 0
$include "Config_AVR-DOS.BAS" ' Include AVR-DOS Configuration and library
Btemp1 = Initfilesystem(1) ' Partition 1
If Btemp1 = 0 Then
Lcdstr "OK" , 0 , 0
Waitms 500
Else
Lcdstr "Fail" , 0 , 0
Wait 2
Goto Reinit
End If
Else
Lcdstr "Fail" , 0 , 0
Waitms 500
Lcdclear 5 , 2 , 4 , 4
Lcdgoxy 2 , 25
Lcdstr "ReInit" , 0 , 0
Goto Reinit
End If
End Sub