circuitar / Dimmer

Arduino library to control dimmable lamps and other AC loads (110V / 220V).
MIT License
77 stars 31 forks source link

Atmega64 support #13

Open rodchyn opened 6 years ago

rodchyn commented 6 years ago

Hi Luis, can you add support for atmega64 chip? I'm using https://github.com/MCUdude/MegaCore for chip support in Arduino IDE and all works but your library use specific timer registers which not exists for atmega64.

Here is what i see in compile window

/home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp: In member function 'void Dimmer::begin(uint8_t, bool)': /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:15:20: error: 'TCCR2A' was not declared in this scope

define _TCCRxA(X) TCCR ## X ## A

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:16:19: note: in expansion of macro '_TCCRxA'

define TCCRxA(X) _TCCRxA(X)

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:157:5: note: in expansion of macro 'TCCRxA' TCCRxA(DIMMER_TIMER) = TCCRxA_VALUE; // Timer config byte A ^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:17:20: error: 'TCCR2B' was not declared in this scope

define _TCCRxB(X) TCCR ## X ## B

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:18:19: note: in expansion of macro '_TCCRxB'

define TCCRxB(X) _TCCRxB(X)

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:158:5: note: in expansion of macro 'TCCRxB' TCCRxB(DIMMER_TIMER) = TCCRxB_VALUE; // Timer config byte B ^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:19:20: error: 'TIMSK2' was not declared in this scope

define _TIMSKx(X) TIMSK ## X

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:20:19: note: in expansion of macro '_TIMSKx'

define TIMSKx(X) _TIMSKx(X)

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:159:5: note: in expansion of macro 'TIMSKx' TIMSKx(DIMMER_TIMER) = 0x02; // Timer Compare Match Interrupt Enable ^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:21:19: error: 'OCR2A' was not declared in this scope

define _OCRxA(X) OCR ## X ## A

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:22:18: note: in expansion of macro '_OCRxA'

define OCRxA(X) _OCRxA(X)

^ /home/rodchyn/sketchbook/libraries/Dimmer/src/Dimmer.cpp:160:5: note: in expansion of macro 'OCRxA' OCRxA(DIMMER_TIMER) = 100 * 60 / acFreq - 1; // Compare value (frequency adjusted)