# HG changeset patch
# User edouard
# Date 1254842132 -7200
# Node ID efb6e88ad27f08bac2171a1a326cf9f913662bb7
# Parent  b2d2c3fab094f956bf8882f36add2facd37a8fcb
Fixed bug in the AVR-CAN driver: the CAN interrupt changes the
selected message object, but does not revert it before exiting.

diff -r b2d2c3fab094 -r efb6e88ad27f 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
   {