diff --git a/slave/slave/lib/inputOutput.c b/slave/slave/lib/inputOutput.c --- a/slave/slave/lib/inputOutput.c +++ b/slave/slave/lib/inputOutput.c @@ -7,11 +7,25 @@ #include - uint8_t io_getModuleId() { + uint8_t io_getModuleId() + { // Get ID from rotary dip and return it. uint8_t id; - id = 0; //DEBUG + id = 0; + + // This method is temporary as the next release will read the module ID from EEPROM + PORTC |= (1 << PC2); // Pull pins on rotary dip high + PORTC |= (1 << PC3); // Pull pins on rotary dip high + PORTC |= (1 << PC4); // Pull pins on rotary dip high + PORTC |= (1 << PC5); // Pull pins on rotary dip high + + //while (id == 0) // Keep reading until valid ID is read + //{ + id = ((PINC & 0b00111100) >> 2); // Read Dip Encoder + id = ~id; //Invert Dip reading + id = (id & 0b1111); //Mask bits + //} return id; } \ No newline at end of file diff --git a/slave/slave/lib/led.c b/slave/slave/lib/led.c --- a/slave/slave/lib/led.c +++ b/slave/slave/lib/led.c @@ -11,10 +11,10 @@ void led_configure() { // Configure ports/pins for LEDs - DDRB |= (1 << DDRB0); // Set PB0 to Output - DDRB |= (1 << DDRB1); // Set PB1 to Output - DDRB |= (1 << DDRB2); // Set PB2 to Output - DDRB |= (1 << DDRB3); // Set PB3 to Output + DDRB |= (1 << DDB0); // Set PB0 to Output + DDRB |= (1 << DDB1); // Set PB1 to Output + DDRB |= (1 << DDB2); // Set PB2 to Output + DDRB |= (1 << DDB3); // Set PB3 to Output // Setup PWM //TODO diff --git a/slave/slave/lib/spi.c b/slave/slave/lib/spi.c --- a/slave/slave/lib/spi.c +++ b/slave/slave/lib/spi.c @@ -20,35 +20,35 @@ void setup_spi() DDRA |= (1<6.0 com.Atmel.AVRGCC8 {40d97b6e-7ff4-48e7-9a9e-5e50ba18526b} - ATmega324P + ATmega644PA none Executable C @@ -48,7 +48,7 @@ 127.0.0.1 - 55286 + 52709 False @@ -56,7 +56,7 @@ 249000 1000000 - 2010000 + 250000 false false 0