Skip to content

Commit

Permalink
embot::prot::can::Frame corrected constructor so that frame length ca…
Browse files Browse the repository at this point in the history
…n be <= 8
  • Loading branch information
marcoaccame committed Aug 18, 2020
1 parent fcfdf90 commit 307734d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emBODY/eBcode/arch-arm/embot/prot/can/embot_prot_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace embot { namespace prot { namespace can {
std::uint8_t filler[3] {0};
std::uint8_t data[8] {0};
Frame() = default;
Frame(std::uint32_t i, std::uint8_t s, std::uint8_t *d) : id(i), size(std::max(s, static_cast<std::uint8_t>(8)))
Frame(std::uint32_t i, std::uint8_t s, std::uint8_t *d) : id(i), size(std::min(s, static_cast<std::uint8_t>(8)))
{
if(nullptr != d) { std::memmove(data, d, size); }
}
Expand Down

0 comments on commit 307734d

Please sign in to comment.