Don't use heavy weapon to get some basic calculation
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 26 Apr 2017 22:44:17 +0000 (00:44 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 26 Apr 2017 23:03:34 +0000 (01:03 +0200)
Change-Id: Ibc820dea7efbc2d7a50671ce66804217c6707d56
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
CAN-binder/low-can-binding/can/can-bus-dev.cpp

index 4737d11..7f7a762 100644 (file)
@@ -21,7 +21,6 @@
 #include <unistd.h>
 #include <linux/can/raw.h>
 #include <linux/can/bcm.h>
-#include <cmath>
 
 #include "can-bus.hpp"
 #include "can-message.hpp"
@@ -132,7 +131,7 @@ int can_bus_dev_t::create_rx_filter(const can_signal_t& s)
        memset(&cfd, 0, sizeof(cfd));
        memset(&bcm_msg.msg_head, 0, sizeof(bcm_msg.msg_head));
        uint8_t bit_size = s.get_bit_size();
-       float val = (float)exp2(bit_size)-1;
+       float val = (float)(1 << bit_size)-1;
 
        bcm_msg.msg_head.opcode  = RX_SETUP;
        bcm_msg.msg_head.can_id  = can_id;