@@ -202,10 +202,22 @@ void main(void){
eeprom_read_block(&settings, &eep_settings, sizeof(struct settings));
+
+ // system timer
OCR2A = (125-1); // 1ms
TCCR2A = _BV(WGM21);
TCCR2B = _BV(CS22);
TIMSK2 = _BV(OCIE2A);
+ // fan pwm timer
+ ICR1 = (330-1); // 25kHz
+ OCR1B = 40;
+ TCCR1A = _BV(COM1B1) | _BV(WGM11);
+ TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10);
+ TCCR1C = 0;
+ DDRD |= _BV(PD4);
sei();
PORTC &= _BV(PC7); // KEY