mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/CAN-Demo.git
synced 2025-09-29 00:37:33 +00:00
Formtatting of messages added
This commit is contained in:
@@ -52,14 +52,14 @@
|
||||
|
||||
}
|
||||
|
||||
void unpackValues(uint8_t packedByte, uint8_t* type_id, uint8_t* sensor_ID, uint8_t* value, uint8_t* include) {
|
||||
extern "C" void unpackValues(uint8_t packedByte, uint8_t* type_id, uint8_t* sensor_ID, uint8_t* value, uint8_t* include) {
|
||||
*type_id = (packedByte >> 6) & 0x03; // Extracting two bits for type_id
|
||||
*sensor_ID = (packedByte >> 3) & 0x07; // Extracting three bits for sensorID
|
||||
*include = (packedByte >> 2) & 0x01; // Extracting the flag for included value
|
||||
*value = (packedByte >> 1) & 0x01; // Extracting one bit for value
|
||||
}
|
||||
|
||||
uint8_t packValues(uint8_t type_id, uint8_t sensor_ID, uint8_t value, uint8_t include) {
|
||||
extern "C" uint8_t packValues(uint8_t type_id, uint8_t sensor_ID, uint8_t value, uint8_t include) {
|
||||
uint8_t packedByte = 0;
|
||||
|
||||
// Shifting and ORing the values
|
||||
|
Reference in New Issue
Block a user