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

Function OD_write_1003

301/CO_Emergency.c:194–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194static ODR_t
195OD_write_1003(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {
196 if ((stream == NULL) || (stream->subIndex != 0U) || (buf == NULL) || (count != 1U) || (countWritten == NULL)) {
197 return ODR_DEV_INCOMPAT;
198 }
199
200 if (CO_getUint8(buf) != 0U) {
201 return ODR_INVALID_VALUE;
202 }
203
204 CO_EM_t* em = (CO_EM_t*)stream->object;
205
206 /* clear error history */
207 em->fifoCount = 0;
208
209 *countWritten = sizeof(uint8_t);
210 return ODR_OK;
211}
212#endif /* (CO_CONFIG_EM) & CO_CONFIG_EM_HISTORY */
213
214#if ((CO_CONFIG_EM)&CO_CONFIG_EM_STATUS_BITS) != 0

Callers

nothing calls this directly

Calls 1

CO_getUint8Function · 0.85

Tested by

no test coverage detected