Skip to content
Snippets Groups Projects
Commit f1ed0370 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fixed incorrect bit shifts in supply voltage and current monitor. The shift...

fixed incorrect bit shifts in supply voltage and current monitor. The shift now is according to the data sheet of the PAC1720.
parent a9943463
No related branches found
Tags 03.02.00
No related merge requests found
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.5)
# Version of the project
set(${PROJECT_NAME}_MAJOR_VERSION 03)
set(${PROJECT_NAME}_MINOR_VERSION 00)
set(${PROJECT_NAME}_PATCH_VERSION 01)
set(${PROJECT_NAME}_PATCH_VERSION 02)
set(${PROJECT_NAME}_FILE_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
# Define the target platform
......
......@@ -264,9 +264,9 @@ void read_power_monitor() {
return;
}
ioctl(i2c0, IO_IOCTL_I2C_STOP, &param);
TC_supply_current = ((value[0] << 8) | value[1]) >> 6;
LD_supply_current = ((value[2] << 8) | value[3]) >> 6;
TC_supply_voltage = ((value[4] << 8) | value[5]) >> 6;
LD_supply_voltage = ((value[6] << 8) | value[7]) >> 6;
TC_supply_current = ((value[0] << 8) | value[1]) >> 4;
LD_supply_current = ((value[2] << 8) | value[3]) >> 4;
TC_supply_voltage = ((value[4] << 8) | value[5]) >> 5;
LD_supply_voltage = ((value[6] << 8) | value[7]) >> 5;
_io_fflush(i2c0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment