]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/i82527.c
Changed baudrate calculation to consider DSC selection.
[lincan.git] / lincan / src / i82527.c
index 00dd885b652dca00b028385f32c48c54f4ae232d..66bdc553cd1918ae136c7c9901641289f874c5d3 100644 (file)
@@ -131,7 +131,8 @@ int i82527_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw,
        if (i82527_enable_configuration(chip))
                return -ENODEV;
 
-       clock /=2;
+       if(chip->int_cpu_reg & iCPU_DSC)
+               clock /=2;
 
        /* tseg even = round down, odd = round up */
        for (tseg=(0+0+2)*2; tseg<=(MAX_TSEG2+MAX_TSEG1+2)*2+1; tseg++) {