summaryrefslogtreecommitdiffstats
path: root/ucs2-vol/src
diff options
context:
space:
mode:
Diffstat (limited to 'ucs2-vol/src')
-rw-r--r--ucs2-vol/src/CMakeLists.txt4
-rw-r--r--ucs2-vol/src/device_value.cpp20
-rw-r--r--ucs2-vol/src/libmostvolume.cpp6
-rw-r--r--ucs2-vol/src/setup.cpp14
4 files changed, 22 insertions, 22 deletions
diff --git a/ucs2-vol/src/CMakeLists.txt b/ucs2-vol/src/CMakeLists.txt
index 8bb406e..64ef536 100644
--- a/ucs2-vol/src/CMakeLists.txt
+++ b/ucs2-vol/src/CMakeLists.txt
@@ -32,8 +32,8 @@ ADD_LIBRARY(ucs2-vol STATIC callbacks.cpp device_container.cpp device_value.cpp
)
# Define properties to expose when others use this target
- TARGET_INCLUDE_DIRECTORIES(ucs2-vol
- PUBLIC
+ TARGET_INCLUDE_DIRECTORIES(ucs2-vol
+ PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../inc
${CMAKE_CURRENT_SOURCE_DIR}/../cfg
${CMAKE_CURRENT_SOURCE_DIR}/ucs-xml
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;
}
diff --git a/ucs2-vol/src/libmostvolume.cpp b/ucs2-vol/src/libmostvolume.cpp
index 4581be7..a44d4bd 100644
--- a/ucs2-vol/src/libmostvolume.cpp
+++ b/ucs2-vol/src/libmostvolume.cpp
@@ -27,14 +27,14 @@
static bool _running = false;
-extern "C" uint8_t lib_most_volume_init(Ucs_Inst_t *unicens_inst, lib_most_volume_service_cb_t req_service_fptr)
+extern "C" uint8_t lib_most_volume_init(Ucs_Inst_t *UNICENS_inst, lib_most_volume_service_cb_t req_service_fptr)
{
uint8_t success = 1U;
/*std::cerr << "lib_most_volume_init(): called" << std::endl;*/
if (!_running)
{
- CSetup::GetInstance()->Configure(unicens_inst, req_service_fptr);
+ CSetup::GetInstance()->Configure(UNICENS_inst, req_service_fptr);
success = 0U;
_running = true;
}
@@ -83,4 +83,4 @@ extern "C" uint8_t lib_most_volume_service(void)
}
return success;
-} \ No newline at end of file
+}
diff --git a/ucs2-vol/src/setup.cpp b/ucs2-vol/src/setup.cpp
index 5ff3d79..bb54f2f 100644
--- a/ucs2-vol/src/setup.cpp
+++ b/ucs2-vol/src/setup.cpp
@@ -28,9 +28,9 @@ CSetup* CSetup::_instance = NULL;
// singleton
CSetup* CSetup::GetInstance() {
if (_instance == NULL) {
- _instance = new CSetup();
+ _instance = new CSetup();
}
-
+
return _instance;
}
@@ -53,7 +53,7 @@ CSetup::CSetup()
_volume_amp_272_l(0x272U, DEVICE_VAL_LEFT, LIB_MOST_VOLUME_CH_CENTER),
_volume_amp_272_r(0x272U, DEVICE_VAL_RIGHT, LIB_MOST_VOLUME_CH_SUB),
_value_container()
-{
+{
static CDeviceValue* value_list[3] = { &_volume_amp_270_m,
&_volume_amp_270_l,
&_volume_amp_270_r/*,
@@ -72,10 +72,10 @@ CSetup::~CSetup()
}
-void CSetup::Configure(Ucs_Inst_t *unicens_inst, lib_most_volume_service_cb_t service_fptr)
+void CSetup::Configure(Ucs_Inst_t *UNICENS_inst, lib_most_volume_service_cb_t service_fptr)
{
- ucs_inst = unicens_inst;
- _value_container.AssignService(service_fptr, unicens_inst);
+ ucs_inst = UNICENS_inst;
+ _value_container.AssignService(service_fptr, UNICENS_inst);
}
Ucs_Inst_t* CSetup::RetrieveUnicensInst(void)
@@ -91,4 +91,4 @@ void CSetup::SetVolume(enum lib_most_volume_channel_t channel, uint8_t volume)
void CSetup::Update()
{
_value_container.Update();
-} \ No newline at end of file
+}