Rev 1977 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1977 | Rev 2012 | ||
|---|---|---|---|
| Line 60... | Line 60... | ||
| 60 | #define act_hwPWM_CH1_FACT (256UL*act_hwPWM_CH1_TOP)/10000UL |
60 | #define act_hwPWM_CH1_FACT (256UL*act_hwPWM_CH1_TOP)/10000UL |
| 61 | #define act_hwPWM_CH2_FACT (256UL*act_hwPWM_CH2_TOP)/10000UL |
61 | #define act_hwPWM_CH2_FACT (256UL*act_hwPWM_CH2_TOP)/10000UL |
| 62 | 62 | ||
| 63 | #if act_hwPWM_CH1_WGM==4 || act_hwPWM_CH1_WGM>7 |
63 | #if act_hwPWM_CH1_WGM==4 || act_hwPWM_CH1_WGM>7 |
| 64 | #error Not supported Waveform Generation Mode on CH1 and CH2 |
64 | #error Not supported Waveform Generation Mode on CH1 and CH2 |
| - | 65 | #endif |
|
| - | 66 | ||
| - | 67 | #if act_hwPWM_CH3_WGM==2 || act_hwPWM_CH3_WGM>3 |
|
| - | 68 | //#error Not supported Waveform Generation Mode on CH3 and CH4 |
|
| - | 69 | // Supported but you need to know how to use it |
|
| - | 70 | #warning Waveform Generation Mode only supports 50% dutycycle and setting frequency as pwmvalue |
|
| - | 71 | #define act_hwPWM_CH3_TOP 0xff |
|
| - | 72 | #define act_hwPWM_CH4_TOP 0xff |
|
| 65 | #endif |
73 | #endif |
| 66 | 74 | ||
| 67 | 75 | ||
| 68 | #if act_hwPWM_CH3_WGM==0 || act_hwPWM_CH3_WGM==1 || act_hwPWM_CH3_WGM==3 |
76 | #if act_hwPWM_CH3_WGM==0 || act_hwPWM_CH3_WGM==1 || act_hwPWM_CH3_WGM==3 |
| 69 | #define act_hwPWM_CH3_TOP 0xff |
77 | #define act_hwPWM_CH3_TOP 0xff |
| 70 | #define act_hwPWM_CH4_TOP 0xff |
78 | #define act_hwPWM_CH4_TOP 0xff |
| 71 | #endif |
79 | #endif |
| 72 | #define act_hwPWM_CH3_FACT (256UL*act_hwPWM_CH3_TOP)/10000UL |
80 | #define act_hwPWM_CH3_FACT (256UL*act_hwPWM_CH3_TOP)/10000UL |
| 73 | #define act_hwPWM_CH4_FACT (256UL*act_hwPWM_CH4_TOP)/10000UL |
81 | #define act_hwPWM_CH4_FACT (256UL*act_hwPWM_CH4_TOP)/10000UL |
| 74 | - | ||
| 75 | #if act_hwPWM_CH3_WGM==2 || act_hwPWM_CH3_WGM>3 |
- | |
| 76 | #error Not supported Waveform Generation Mode on CH3 and CH4 |
- | |
| 77 | #endif |
- | |
| 78 | 82 | ||
| 79 | #define OCR_1 OCR1B |
83 | #define OCR_1 OCR1B |
| 80 | #define OCR_2 OCR1A |
84 | #define OCR_2 OCR1A |
| 81 | #define OCR_3 OCR0A |
85 | #define OCR_3 OCR0A |
| 82 | #define OCR_4 OCR0B |
86 | #define OCR_4 OCR0B |