From 1fe55667142158af865372a8b9916581662286fe Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 27 Jun 2017 17:18:55 +0200 Subject: Change marketing stuff unicens -> UNICENS MicroChip -> Microchip Change-Id: I7a2f48ac62f44579831ed252b5e24dc918c09645 Signed-off-by: Romain Forlot --- ucs2-vol/src/device_value.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ucs2-vol/src/device_value.cpp') diff --git a/ucs2-vol/src/device_value.cpp b/ucs2-vol/src/device_value.cpp index 5a1ad5c..95ea256 100644 --- a/ucs2-vol/src/device_value.cpp +++ b/ucs2-vol/src/device_value.cpp @@ -35,31 +35,31 @@ #define CONTROL_CH_1 0x08U #define CONTROL_CH_2 0x09U -CDeviceValue::CDeviceValue(uint16_t address, DeviceValueType type, uint16_t key) +CDeviceValue::CDeviceValue(uint16_t address, DeviceValueType type, uint16_t key) { this->_is_initial = true; this->_address = address; this->_target_value = 0x01u; this->_actual_value = 0x01u; - + this->_type = type; this->_key = key; - + _tx_payload[0] = CONTROL_MASTER;// 7: master, 8: channel 1, 9: Channel 2 _tx_payload[1] = MUTE_VALUE_HB; //HB:Volume _tx_payload[2] = MUTE_VALUE_LB; //LB:Volume _tx_payload_sz = 3u; } -CDeviceValue::~CDeviceValue() +CDeviceValue::~CDeviceValue() { } void CDeviceValue::ApplyMostValue(uint8_t value, DeviceValueType type, uint8_t tx_payload[]) { uint16_t tmp = MUTE_VALUE; - - switch (type) + + switch (type) { case DEVICE_VAL_LEFT: tmp = 0x80U + 0x37FU - (0x37FU * ((int32_t)value) / (0xFFU)); @@ -80,19 +80,19 @@ void CDeviceValue::ApplyMostValue(uint8_t value, DeviceValueType type, uint8_t t tx_payload[0] = CONTROL_MASTER; break; } - + tx_payload[1] = (uint8_t)((tmp >> 8U) & (uint16_t)0xFFU); //HB:Volume tx_payload[2] = (uint8_t)(tmp & (uint16_t)0xFFU); //LB:Volume } // returns true if target is not actual value -bool CDeviceValue::RequiresUpdate() +bool CDeviceValue::RequiresUpdate() { - if (this->_target_value != this->_actual_value) + if (this->_target_value != this->_actual_value) { return true; } - + return false; } -- cgit 1.2.3-korg