* Custom functions for read/write OD object "COB-ID EMCY" * * For more information see file CO_ODinterface.h, OD_IO_t. */
| 107 | * For more information see file CO_ODinterface.h, OD_IO_t. |
| 108 | */ |
| 109 | static ODR_t |
| 110 | OD_read_1014_default(OD_stream_t* stream, void* buf, OD_size_t count, OD_size_t* countRead) { |
| 111 | if ((stream == NULL) || (stream->subIndex != 0U) || (buf == NULL) || (count < sizeof(uint32_t)) |
| 112 | || (countRead == NULL)) { |
| 113 | return ODR_DEV_INCOMPAT; |
| 114 | } |
| 115 | |
| 116 | CO_EM_t* em = (CO_EM_t*)stream->object; |
| 117 | |
| 118 | uint32_t COB_IDEmergency32 = em->producerEnabled ? 0U : 0x80000000U; |
| 119 | COB_IDEmergency32 |= CO_CAN_ID_EMERGENCY + (uint32_t)em->nodeId; |
| 120 | (void)CO_setUint32(buf, COB_IDEmergency32); |
| 121 | |
| 122 | *countRead = sizeof(uint32_t); |
| 123 | return ODR_OK; |
| 124 | } |
| 125 | #endif /* (CO_CONFIG_EM) & CO_CONFIG_EM_PROD_CONFIGURABLE */ |
| 126 | |
| 127 | #if ((CO_CONFIG_EM)&CO_CONFIG_EM_PROD_INHIBIT) != 0 |
nothing calls this directly
no test coverage detected