Skip to content
Snippets Groups Projects

fix/voltage overflow

Merged Martin Killenberg requested to merge fix/voltage_overflow into master
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -32,7 +32,6 @@
#include "eeprom.h"
#include "fan_current_monitor_lib.h" // added by Stanislav Chystiakov
#include "fan_lib.h" // added by Stanislav Chystiakov
#include "version.h"
#include "hw_info.h"
#include "mgmt_protocol_master.h"
#include "overcurrent_detction.h"
@@ -40,6 +39,7 @@
#include "uptime_tracker.h"
#include "usart_lib.h"
#include "user_board.h"
#include "version.h"
#include "xport_watchdog.h"
#include <avr/eeprom.h>
#include <ctype.h>
@@ -654,12 +654,12 @@ char uppercase(char c) {
*/
void printChannel(int nr) {
uint8_t status = cl_getStatus(nr);
int voltage;
int32_t voltage;
uint16_t current;
char name_upper[EEPROM_CHNAME_LEN];
current = pm_getCurrent(nr);
voltage = (int)pm_getVoltage(nr);
voltage = pm_getVoltage(nr);
if(current == 0xffff || voltage == 0x7fffffff) { // I2C error
current = 0;
@@ -675,7 +675,7 @@ void printChannel(int nr) {
name_upper[i] = uppercase(name_upper[i]);
}
printf("\r\n%1d %02X %6d %" PRIu16 " %-20s", nr, status, voltage, current, name_upper);
printf("\r\n%1d %02X %6ld %" PRIu16 " %-20s", nr, status, voltage, current, name_upper);
}
void printAlarmMasks(void) {
Loading