Fixed bug in the AVR-CAN driver: the CAN interrupt changes the
authoredouard
Tue, 06 Oct 2009 17:15:32 +0200
changeset 601 efb6e88ad27f
parent 599 b2d2c3fab094
child 602 cbf29cccec18
Fixed bug in the AVR-CAN driver: the CAN interrupt changes the
selected message object, but does not revert it before exiting.
drivers/AVR/can_AVR.c
--- a/drivers/AVR/can_AVR.c	Mon Oct 05 14:31:55 2009 +0200
+++ b/drivers/AVR/can_AVR.c	Tue Oct 06 17:15:32 2009 +0200
@@ -174,6 +174,7 @@
 CAN Interrupt
 ******************************************************************************/
 {
+  unsigned char saved_page = CANPAGE;
   unsigned char i;
 
   if (CANGIT & (1 << CANIT))	// is a messagebox interrupt
@@ -211,6 +212,8 @@
     }
   }
 
+  CANPAGE = saved_page;
+
   // Bus Off Interrupt Flag
   if (CANGIT & (1 << BOFFIT))    // Finaly clear the interrupt status register
   {