Skip to content

[STM32] CAN write() return value #3464

Closed
@szechyjs

Description

@szechyjs

Description

According to the CAN.h header file the write() method is only supposed to return 1 if send was successful. 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 write was successful.

Actual behavior
Returns 1 regardless if write was successful.

Steps to reproduce

if (can1.write(CANMessage(1337, &data, sizeof(data)))
{
    // This will always print
    printf("tx\n");
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions