Rev 1382 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1382 | Rev 1396 | ||
|---|---|---|---|
| Line 105... | Line 105... | ||
| 105 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_PID; ///TODO: Change this to the actual module type |
105 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_PID; ///TODO: Change this to the actual module type |
| 106 | txMsg.Header.ModuleId = act_PID_ID; |
106 | txMsg.Header.ModuleId = act_PID_ID; |
| 107 | txMsg.Header.Command = CAN_MODULE_CMD_PID_PID_STATUS; |
107 | txMsg.Header.Command = CAN_MODULE_CMD_PID_PID_STATUS; |
| 108 | txMsg.Length = 8; |
108 | txMsg.Length = 8; |
| 109 | txMsg.Data[0] = (uint8_t)0x00ff & (((uint32_t)(measurementValue*64))>>8); |
109 | txMsg.Data[0] = (uint8_t)0x00ff & (((uint32_t)(measurementValue*64))>>8); |
| 110 | txMsg.Data[1] = (uint8_t)0x00ff & ((uint32_t)measurementValue* |
110 | txMsg.Data[1] = (uint8_t)0x00ff & ((uint32_t)(measurementValue*64)); |
| 111 | txMsg.Data[2] = (uint8_t)0x00ff & (((uint32_t)(referenceValue*64))>>8); |
111 | txMsg.Data[2] = (uint8_t)0x00ff & (((uint32_t)(referenceValue*64))>>8); |
| 112 | txMsg.Data[3] = (uint8_t)0x00ff & ((uint32_t)referenceValue* |
112 | txMsg.Data[3] = (uint8_t)0x00ff & ((uint32_t)(referenceValue*64)); |
| 113 | //uint16_t tempPWM =(uint16_t) (pwmValue*10000); |
113 | //uint16_t tempPWM =(uint16_t) (pwmValue*10000); |
| 114 | txMsg.Data[4] = ( (pwmValue)>>8)&0xff; |
114 | txMsg.Data[4] = ( (pwmValue)>>8)&0xff; |
| 115 | txMsg.Data[5] = ( (pwmValue))&0xff; |
115 | txMsg.Data[5] = ( (pwmValue))&0xff; |
| 116 | txMsg.Data[6] = ((int16_t) (pidDebugData.Sum)>>8)&0xff; |
116 | txMsg.Data[6] = ((int16_t) (pidDebugData.Sum)>>8)&0xff; |
| 117 | txMsg.Data[7] = ((int16_t) (pidDebugData.Sum))&0xff; |
117 | txMsg.Data[7] = ((int16_t) (pidDebugData.Sum))&0xff; |