 |
www.elektronik.si Forum o elektrotehniki in računalništvu
|
Poglej prejšnjo temo :: Poglej naslednjo temo |
Avtor |
Sporočilo |
SimonS Član



Pridružen-a: Čet 01 Jul 2004 11:18 Prispevkov: 4770 Aktiv.: 20.09 Kraj: Kobarid
|
Objavljeno: Pet Okt 03, 2008 7:34 pm Naslov sporočila: LPC 2138 se zasteka |
|
|
Pozdrav
Nikakor mi ni jasno. Če poklicem to podrutino se program zašteka.
Koda: |
void casovno (void) //vklopi se moznost casovno spreminjanje nastavitev T in V
{
unsigned int save_VicInt; // for saving of interrupt enable register
unsigned char a;
char izpis[16];
save_VicInt = VICIntEnable; // save interrupt enable status
VICIntEnClr = 0xFFFFFFFF; // disable all interrupts
CCR = 0x2; //reset RTC
LCD_cls();
if (stanje.jezik == 1)LCD_puts ("Casovni rezim ");
if (stanje.jezik == 2)LCD_puts ("Period ");
if (stanje.jezik == 3)LCD_puts ("regime del tempo");
if (stanje.jezik == 4)LCD_puts ("Regime temporel ");
if (stanje.jezik == 5)LCD_puts ("Zeitabschnitt ");
while (!(IO0PIN & BIT(18))); // dokler ne izpustimo tipke
udelay(2000);
stanje.rezim=1;
while ((IO0PIN & BIT(20))) // cakamo na stisk tipke MENU
{
if (!(IO0PIN & BIT(19))) //tipka -
{
if (stanje.rezim > 1) stanje.rezim--;
while (!(IO0PIN & BIT(19))); // dokler ne izpustimo tipke
}
if (!(IO0PIN & BIT(18))) //tipka +
{
if (stanje.rezim < 20) stanje.rezim++;
while (!(IO0PIN & BIT(18))); // dokler ne izpustimo tipke
}
LCD_gotoxy(1,2);
if (stanje.jezik == 1)sprintf(izpis," %2d faza",stanje.rezim);
if (stanje.jezik == 2)sprintf(izpis," %2d regime",stanje.rezim);
if (stanje.jezik == 3)sprintf(izpis," %2d faze",stanje.rezim);
if (stanje.jezik == 4)sprintf(izpis," %2d regime",stanje.rezim);
if (stanje.jezik == 5)sprintf(izpis," %2d phase",stanje.rezim);
LCD_puts(izpis);
}
ILR =2; //1 //brisemo prekinitve
udelay (1000);
while (!(IO0PIN & BIT(20))) // cakamo na stisk tipke MENU
udelay (1000);
a= stanje.rezim *6;
tnas = RAMdata[(a+6)];
ttol = RAMdata[(a+7)];
hnas = RAMdata[(a+8)];
htol = RAMdata[(a+9)];
ALMIN = RAMdata[(a+5)];
ALHOUR = RAMdata[(a+4)] % 24; // ure
ALDOY = RAMdata[(a+4)] / 24; // dni
LCD_gotoxy(1,2);
AMR = BIT(0)|BIT(3)|BIT(4)|BIT(6)|BIT(7); // kar NE rabimo moramo maskirati M,U, dni v letu
CCR = 0x1; //pozeni RTC preko glavnega kristala
VICIntEnable = save_VicInt; // enable interrupts
LCD_puts ("4 ");
VICIntEnable |= 0x2000; //vklopimo se RTC prekinitev
LCD_cls();
|
Zasteka pa se na stavku "VICIntEnable |= 0x2000;"
Res na vidim pametne razlage zakaj..... Dobivam pa sive lase  _________________ Lep dan
Simon |
|
Nazaj na vrh |
|
 |
|
|
Ne, ne moreš dodajati novih tem v tem forumu Ne, ne moreš odgovarjati na teme v tem forumu Ne, ne moreš urejati svojih prispevkov v tem forumu Ne, ne moreš brisati svojih prispevkov v tem forumu Ne ne moreš glasovati v anketi v tem forumu Ne, ne moreš pripeti datotek v tem forumu Ne, ne moreš povleči datotek v tem forumu
|
Uptime: 7 dni
Powered by phpBB © 2001, 2005 phpBB Group
|