Subversion Repositories group.NITPanels

Rev

Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 20
Line 120... Line 120...
120
  */
120
  */
121
  DDRD          = 0B11100011;
121
  DDRD          = 0B11100011;
122
  PORTD         = 0B00000011;
122
  PORTD         = 0B00000011;
123
 
123
 
124
	// The USB connect stuff, flash the power led
124
	// The USB connect stuff, flash the power led
125
  	sbi(PORTC, PC0);
125
  	sbi(PORTC, PC1);
126
    usbDeviceDisconnect();
126
    usbDeviceDisconnect();
127
    _delay_ms(500);
127
    _delay_ms(500);
128
    usbDeviceConnect();
128
    usbDeviceConnect();
129
    cbi(PORTC, PC0);
129
    cbi(PORTC, PC1);
130
 
130
 
131
    // @TODO: Don't really need the system time anymore, remove?
131
    // @TODO: Don't really need the system time anymore, remove?
132
    TIMSK0 = (1<<TOIE0);            // Enable timer overflow
132
    TIMSK0 = (1<<TOIE0);            // Enable timer overflow
133
    TCNT0 = 0x00;                   // Set Timer0 initial value to 0
133
    TCNT0 = 0x00;                   // Set Timer0 initial value to 0
134
    TCCR0B = (1<< CS00) ;           // /1 prescaler
134
    TCCR0B = (1<< CS00) ;           // /1 prescaler
Line 159... Line 159...
159
	PORTB &= 0xE0;
159
	PORTB &= 0xE0;
160
	PORTB |= (0x1F & (currLeds >> 3));
160
	PORTB |= (0x1F & (currLeds >> 3));
161
	PORTD &= 0x1F;
161
	PORTD &= 0x1F;
162
	PORTD |= (0xE0 & (currLeds << 5));
162
	PORTD |= (0xE0 & (currLeds << 5));
163
 
163
 
164
	// Set the power led if required
164
	// Set the power led state
165
	// @TODO: Check this works
-
 
166
	if (pwrLed)
165
	if (pwrLed)
167
		sbi(PORTC, PC1);
166
		sbi(PORTC, PC1);
168
	else
167
	else
169
		cbi(PORTC, PC1);
168
		cbi(PORTC, PC1);
170
}
169
}