include: can: Fix positive and overlapping error numbers

The error numbers are currently not negative an CAN_TIMEOUT overlapps
with TX errors. Fix that by making the numbers negative and timeout
the first negative number.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is contained in:
Alexander Wachter 2019-02-28 10:38:05 +01:00 committed by Kumar Gala
parent d01f75be7e
commit 8aab2e7bb9

View File

@ -39,19 +39,19 @@ extern "C" {
/** send successfully */
#define CAN_TX_OK (0)
/** general send error */
#define CAN_TX_ERR (1)
#define CAN_TX_ERR (-2)
/** bus arbitration lost during sending */
#define CAN_TX_ARB_LOST (2)
#define CAN_TX_ARB_LOST (-3)
/** controller is in bus off state */
#define CAN_TX_BUS_OFF (3)
#define CAN_TX_BUS_OFF (-4)
/** unexpected error */
#define CAN_TX_UNKNOWN (4)
#define CAN_TX_UNKNOWN (-5)
/** attach_* failed because there is no unused filter left*/
#define CAN_NO_FREE_FILTER (-1)
/** operation timed out*/
#define CAN_TIMEOUT (1)
#define CAN_TIMEOUT (-1)
/**
* @brief Statically define and initialize a can message queue.