diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 00:44:17 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 01:03:34 +0200 |
commit | 512336b68da052f167bdfb8f2b9a9992ed3f1688 (patch) | |
tree | 431fed79301eb870def3022759cfaf34aa276da1 /CAN-binder/low-can-binding/can | |
parent | aa5c3cf6f9ab1e1f26559745bb64534f68a6f80a (diff) |
Don't use heavy weapon to get some basic calculation
Change-Id: Ibc820dea7efbc2d7a50671ce66804217c6707d56
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus-dev.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.cpp b/CAN-binder/low-can-binding/can/can-bus-dev.cpp index 4737d11..7f7a762 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp @@ -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; |