MCPcopy Create free account
hub / github.com/CANopenNode/CANopenNode / OD_write_1015

Function OD_write_1015

301/CO_Emergency.c:133–148  ·  view source on GitHub ↗

* Custom function for writing OD object "Inhibit time EMCY" * * For more information see file CO_ODinterface.h, OD_IO_t. */

Source from the content-addressed store, hash-verified

131 * For more information see file CO_ODinterface.h, OD_IO_t.
132 */
133static ODR_t
134OD_write_1015(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {
135 if ((stream == NULL) || (stream->subIndex != 0U) || (buf == NULL) || (count != sizeof(uint16_t))
136 || (countWritten == NULL)) {
137 return ODR_DEV_INCOMPAT;
138 }
139
140 CO_EM_t* em = (CO_EM_t*)stream->object;
141
142 /* update object */
143 em->inhibitEmTime_us = (uint32_t)CO_getUint16(buf) * 100U;
144 em->inhibitEmTimer = 0;
145
146 /* write value to the original location in the Object Dictionary */
147 return OD_writeOriginal(stream, buf, count, countWritten);
148}
149#endif /* (CO_CONFIG_EM) & CO_CONFIG_EM_PROD_INHIBIT */
150#endif /* (CO_CONFIG_EM) & CO_CONFIG_EM_PRODUCER */
151

Callers

nothing calls this directly

Calls 2

CO_getUint16Function · 0.85
OD_writeOriginalFunction · 0.85

Tested by

no test coverage detected