-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
- Type: Bug
- Priority: Major
According to the CAN.h header file the read()
method is only supposed to return 1
if data was read. All of the STM32 implementations in can_api.c
are hard coded to return 1;
.
The NXP targets implement this correctly, can_api.c
Bug
Target
STM32
Expected behavior
Only return 1
if new data was read.
Actual behavior
Returns 1
regardless if data was received or not. If a message has previously been received then this will be returned again.
Steps to reproduce
CANMessage msg;
while(true)
{
if (can1.read(msg))
{
// This will always print
printf("rx -id: %i, data: %x\n", msg.id, *msg.data);
}
}