|
From: Mario K. <ma...@kl...> - 2001-09-14 18:22:10
|
-----BEGIN PGP SIGNED MESSAGE----- On Friday, 14. September 2001 07:27, M.v...@ca... wrote: > My initial program was just main and serial, trying to get that > working. Eventually I got it going satisfactorily. The serial > routines I use are basically a rip-off of the serial.c available at > the okr site, written by Victoria Welch (who based her code on > something written for keil). > ... > All fine and good. > > Then, I tried to add my periodic interrupt. This is when things > started to go pear-shaped... > > The initial version of intr.c used a call-back function passed as a > function-pointer to the init() routine. But this didn't seem to work, > so I tried it without, which seemed to work for a little while, but > also stuffed up other parts of the program... You probably need reentrancy. And if you use a different register bank in your ISR, you need to specify this register bank for each subroutine, you might be calling from interrupt context. In cases like this, it always is a good idea to inspect the assembly code generated. BTW, this is NOT a problem of the compiler, but of the 8051 architecture. IMHO the 8051 architecture, although really fund to program in asm, is a bad choice for programming C. 73, Mario - -- Mario Klebsch ma...@kl... PGP-Key available at http://www.klebsch.de/public.key Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB 1483 30CE 9FB2 A047 9CE0 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5 8B98 9464 53FF 9382 F518 -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 5.0i for non-commercial use MessageID: E8jF0V/9HCAF1L9dQ5fzXZx7vnuwLT/K iQA/AwUBO6JLdzDOn7KgR5zgEQJp2QCgruo1hlLp+mbxw4VpaVKzI1Mj7V8AoMnf 8WsVNdufDGSWxEuBpbfZiLLT =7KM8 -----END PGP SIGNATURE----- |