From: Joseph Coffland Date: Tue, 16 Jan 2018 01:29:32 +0000 (-0800) Subject: Swap load lines X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=3cfcc3933710c1497a2fb5535d1b371681958c41;p=bbctrl-firmware Swap load lines --- diff --git a/src/pwr/config.h b/src/pwr/config.h index 71b5516..34a5ff1 100644 --- a/src/pwr/config.h +++ b/src/pwr/config.h @@ -29,6 +29,7 @@ #include "pins.h" + // Pins enum { AREF_PIN = PORT_A << 3, @@ -49,16 +50,17 @@ enum { PWR_SCK_PIN, PC2_PIN, // NC PWR_RESET, - LOAD1_PIN, // IN3 - LOAD2_PIN, // IN4 + LOAD2_PIN, // IN3 + LOAD1_PIN, // IN4 }; + // ADC enum { CS1_ADC, // Motor current CS2_ADC, // Vdd current - CS3_ADC, // Load 1 current - CS4_ADC, // Load 2 current + CS3_ADC, // Load 2 current + CS4_ADC, // Load 1 current VOUT_ADC, // Motor voltage VIN_ADC, // Input voltage NC6_ADC, diff --git a/src/pwr/main.c b/src/pwr/main.c index a5c1f34..90c766f 100644 --- a/src/pwr/main.c +++ b/src/pwr/main.c @@ -209,8 +209,8 @@ static void read_conversion(uint8_t ch) { case VOUT_ADC: regs[VOUT_REG] = convert_voltage(data); break; case CS1_ADC: regs[MOTOR_REG] = convert_current(data); break; case CS2_ADC: regs[VDD_REG] = convert_current(data); break; - case CS3_ADC: regs[LOAD1_REG] = convert_current(data); break; - case CS4_ADC: regs[LOAD2_REG] = convert_current(data); break; + case CS3_ADC: regs[LOAD2_REG] = convert_current(data); break; + case CS4_ADC: regs[LOAD1_REG] = convert_current(data); break; } }