Skip to content

Commit

Permalink
Removed the option for incorrect callbacks to the empty lock and unlo…
Browse files Browse the repository at this point in the history
…ck methods
  • Loading branch information
Jef-GB committed Dec 21, 2023
1 parent ed10d47 commit 775582c
Showing 1 changed file with 35 additions and 38 deletions.
73 changes: 35 additions & 38 deletions src/config/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,31 @@
******************************************************************************/

/******************************************************************************
* INCLUDES
******************************************************************************/
* INCLUDES
******************************************************************************/

#include "co_core.h"

void COTmrLock (void);
void COTmrUnlock(void);
// void COTmrLock(void);
// void COTmrUnlock(void);

/******************************************************************************
* MANDATORY CALLBACK FUNCTIONS
******************************************************************************/
* MANDATORY CALLBACK FUNCTIONS
******************************************************************************/

WEAK
void CONodeFatalError(void)
WEAK void CONodeFatalError(void)
{
volatile uint8_t debugExit = 0u;

/* Place here your fatal error handling.
* There is most likely a programming error.
* !! Please don't ignore this errors. !!
*/
for (;debugExit == 0u;);
for (; debugExit == 0u;)
;
}

WEAK
void COTmrLock(void)
WEAK void COTmrLock(void)
{
/* This function helps to guarantee the consistancy
* of the internal timer management while interrupted
Expand All @@ -50,10 +49,11 @@ void COTmrLock(void)
* - get a 'timer-mutex' from your RTOS (ensure to
* call COTmrService() in a timer triggered task)
*/
for (;;) // ! This method should be over written by the custom implementation
;
}

WEAK
void COTmrUnlock(void)
WEAK void COTmrUnlock(void)
{
/* This function helps to guarantee the consistancy
* of the internal timer management while interrupted
Expand All @@ -63,14 +63,15 @@ void COTmrUnlock(void)
* - release the 'timer-mutex' from your RTOS (ensure
* to call COTmrService() in a timer triggered task)
*/
for (;;) // ! This method should be over written by the custom implementation
;
}

/******************************************************************************
* OPTIONAL CALLBACK FUNCTIONS
******************************************************************************/
* OPTIONAL CALLBACK FUNCTIONS
******************************************************************************/

WEAK
void CONmtModeChange(CO_NMT *nmt, CO_MODE mode)
WEAK void CONmtModeChange(CO_NMT *nmt, CO_MODE mode)
{
(void)nmt;
(void)mode;
Expand All @@ -80,8 +81,7 @@ void CONmtModeChange(CO_NMT *nmt, CO_MODE mode)
*/
}

WEAK
void CONmtResetRequest(CO_NMT *nmt, CO_NMT_RESET reset)
WEAK void CONmtResetRequest(CO_NMT *nmt, CO_NMT_RESET reset)
{
(void)nmt;
(void)reset;
Expand All @@ -91,8 +91,7 @@ void CONmtResetRequest(CO_NMT *nmt, CO_NMT_RESET reset)
*/
}

WEAK
void CONmtHbConsEvent(CO_NMT *nmt, uint8_t nodeId)
WEAK void CONmtHbConsEvent(CO_NMT *nmt, uint8_t nodeId)
{
(void)nmt;
(void)nodeId;
Expand All @@ -103,8 +102,7 @@ void CONmtHbConsEvent(CO_NMT *nmt, uint8_t nodeId)
*/
}

WEAK
void CONmtHbConsChange(CO_NMT *nmt, uint8_t nodeId, CO_MODE mode)
WEAK void CONmtHbConsChange(CO_NMT *nmt, uint8_t nodeId, CO_MODE mode)
{
(void)nmt;
(void)nodeId;
Expand All @@ -117,7 +115,8 @@ void CONmtHbConsChange(CO_NMT *nmt, uint8_t nodeId, CO_MODE mode)
}

WEAK
CO_ERR COLssLoad(uint32_t *baudrate, uint8_t *nodeId)
CO_ERR
COLssLoad(uint32_t *baudrate, uint8_t *nodeId)
{
(void)baudrate;
(void)nodeId;
Expand All @@ -130,7 +129,8 @@ CO_ERR COLssLoad(uint32_t *baudrate, uint8_t *nodeId)
}

WEAK
CO_ERR COLssStore(uint32_t baudrate, uint8_t nodeId)
CO_ERR
COLssStore(uint32_t baudrate, uint8_t nodeId)
{
(void)baudrate;
(void)nodeId;
Expand All @@ -142,8 +142,7 @@ CO_ERR COLssStore(uint32_t baudrate, uint8_t nodeId)
return (CO_ERR_NONE);
}

WEAK
void COIfCanReceive(CO_IF_FRM *frm)
WEAK void COIfCanReceive(CO_IF_FRM *frm)
{
(void)frm;

Expand All @@ -153,8 +152,7 @@ void COIfCanReceive(CO_IF_FRM *frm)
*/
}

WEAK
void COPdoTransmit(CO_IF_FRM *frm)
WEAK void COPdoTransmit(CO_IF_FRM *frm)
{
(void)frm;

Expand All @@ -165,7 +163,8 @@ void COPdoTransmit(CO_IF_FRM *frm)
}

WEAK
int16_t COPdoReceive(CO_IF_FRM *frm)
int16_t
COPdoReceive(CO_IF_FRM *frm)
{
(void)frm;

Expand All @@ -175,11 +174,10 @@ int16_t COPdoReceive(CO_IF_FRM *frm)
* object dictionary afterwards or suppress the
* write operation.
*/
return(0u);
return (0u);
}

WEAK
void COPdoSyncUpdate(CO_RPDO *pdo)
WEAK void COPdoSyncUpdate(CO_RPDO *pdo)
{
(void)pdo;

Expand All @@ -190,7 +188,8 @@ void COPdoSyncUpdate(CO_RPDO *pdo)
}

WEAK
int16_t COParaDefault(struct CO_PARA_T *pg)
int16_t
COParaDefault(struct CO_PARA_T *pg)
{
(void)pg;

Expand All @@ -201,8 +200,7 @@ int16_t COParaDefault(struct CO_PARA_T *pg)
return (0u);
}

WEAK
void CORpdoWriteData(CO_IF_FRM *frm, uint8_t pos, uint8_t size, CO_OBJ *obj)
WEAK void CORpdoWriteData(CO_IF_FRM *frm, uint8_t pos, uint8_t size, CO_OBJ *obj)
{
(void)frm;
(void)pos;
Expand All @@ -215,8 +213,7 @@ void CORpdoWriteData(CO_IF_FRM *frm, uint8_t pos, uint8_t size, CO_OBJ *obj)
*/
}

WEAK
void COTpdoReadData(CO_IF_FRM *frm, uint8_t pos, uint8_t size, CO_OBJ *obj)
WEAK void COTpdoReadData(CO_IF_FRM *frm, uint8_t pos, uint8_t size, CO_OBJ *obj)
{
(void)frm;
(void)pos;
Expand Down

0 comments on commit 775582c

Please sign in to comment.