Swap load lines
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Tue, 16 Jan 2018 01:29:32 +0000 (17:29 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Tue, 16 Jan 2018 01:29:32 +0000 (17:29 -0800)
src/pwr/config.h
src/pwr/main.c

index 71b5516a79f7f346a59b0304df376cdf90987f0b..34a5ff1d83f2ca6dbb6afd127aa275bcf7f1fe3b 100644 (file)
@@ -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,
index a5c1f34b0ce94e1bbd55575db5733597738f1bd8..90c766fbc66944aa3ec974072de26a9e18f0c2be 100644 (file)
@@ -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;
   }
 }