Fixed bug message objects indexing introduced by previous driver changes.
authorppisa <ppisa>
Tue, 30 Aug 2005 22:42:33 +0000 (22:42 +0000)
committerppisa <ppisa>
Tue, 30 Aug 2005 22:42:33 +0000 (22:42 +0000)
This indicates, that i82527 requires more testing after 0.3.x driver
changes.

lincan/src/i82527.c

index 60096c5..5ef9d8f 100644 (file)
@@ -248,7 +248,7 @@ int i82527_clear_objects(struct canchip_t *chip)
 
        DEBUGMSG("Cleared all message objects on chip\n");
 
-       for (i=1; i<=15; i++) {
+       for (i=0; i<chip->max_objects; i++) {
                obj=chip->msgobj[i];
                canobj_write_reg(chip,obj,(INTPD_RES|RXIE_RES|TXIE_RES|MVAL_RES),iMSGCTL0);
                canobj_write_reg(chip,obj,(NEWD_RES|MLST_RES|TXRQ_RES|RMPD_RES), iMSGCTL1);
@@ -665,7 +665,7 @@ int i82527_irq_handler(int irq, struct canchip_t *chip)
                
                if (irq_register == 0x02)
                        object = 14;
-               else if(irq_register < 14)
+               else if(irq_register <= 13+3)
                        object = irq_register-3;
                else
                        return CANCHIP_IRQ_NONE;