Rev 2115 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2115 | Rev 2299 | ||
|---|---|---|---|
| Line 12... | Line 12... | ||
| 12 | 12 | ||
| 13 | uint16_t hw_demoEndValue[4] = {0,0,0,0}; |
13 | uint16_t hw_demoEndValue[4] = {0,0,0,0}; |
| 14 | uint16_t hw_demoHighValue[4] = {0,0,0,0}; |
14 | uint16_t hw_demoHighValue[4] = {0,0,0,0}; |
| 15 | uint8_t hw_demoState[4] = {ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING}; |
15 | uint8_t hw_demoState[4] = {ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING, ACT_HWPWM_DEMO_STATE_NOT_RUNNING}; |
| 16 | 16 | ||
| 17 | static uint16_t lookuptable[257] PROGMEM = |
17 | static const uint16_t lookuptable[257] PROGMEM = |
| 18 | { |
18 | { |
| 19 | 0 , 4 , 8 , 12 , 17 , 21 , 25 , 30 , 34 , 39 , //0 |
19 | 0 , 4 , 8 , 12 , 17 , 21 , 25 , 30 , 34 , 39 , //0 |
| 20 | 43 , 48 , 52 , 57 , 62 , 67 , 72 , 77 , 82 , 87 , //10 |
20 | 43 , 48 , 52 , 57 , 62 , 67 , 72 , 77 , 82 , 87 , //10 |
| 21 | 93 , 98 , 104 , 109 , 115 , 120 , 126 , 132 , 138 , 144 , //20 |
21 | 93 , 98 , 104 , 109 , 115 , 120 , 126 , 132 , 138 , 144 , //20 |
| 22 | 150 , 156 , 162 , 169 , 175 , 182 , 188 , 195 , 202 , 209 , //30 |
22 | 150 , 156 , 162 , 169 , 175 , 182 , 188 , 195 , 202 , 209 , //30 |
| Line 388... | Line 388... | ||
| 388 | { |
388 | { |
| 389 | TCCR0A|=(act_hwPWM_CH3_COM<<COM0A0); |
389 | TCCR0A|=(act_hwPWM_CH3_COM<<COM0A0); |
| 390 | } |
390 | } |
| 391 | sei(); |
391 | sei(); |
| 392 | Timer_SetTimeout(act_hwPWM_STORE_VALUE_TIMEOUT, act_hwPWM_STORE_VALUE_TIMEOUT_TIME*1000, TimerTypeOneShot, 0); |
392 | Timer_SetTimeout(act_hwPWM_STORE_VALUE_TIMEOUT, act_hwPWM_STORE_VALUE_TIMEOUT_TIME*1000, TimerTypeOneShot, 0); |
| 393 | //printf("CH2 PWM: %u, LED: %u, ORG: %u\n",pwmValue[2],(uint16_t)((lookuptable |
393 | //printf("CH2 PWM: %u, LED: %u, ORG: %u\n",pwmValue[2],(uint16_t)((pgm_read_word(&lookuptable[(pwmValue[2]/39)])*act_hwPWM_CH3_FACT)>>8) |
| - | 394 | , (uint16_t)((pwmValue[2]*act_hwPWM_CH3_FACT)>>8)); |
|
| 394 | } |
395 | } |
| 395 | #endif |
396 | #endif |
| 396 | #if act_hwPWM_CH4_COM>0 |
397 | #if act_hwPWM_CH4_COM>0 |
| 397 | # if act_hwPWM_CH4_LED>0 |
398 | # if act_hwPWM_CH4_LED>0 |
| 398 | # define CH4_calculation ((pgm_read_word(&lookuptable[(pwmValue[3]/39)])*act_hwPWM_CH4_FACT)>>8) |
399 | # define CH4_calculation ((pgm_read_word(&lookuptable[(pwmValue[3]/39)])*act_hwPWM_CH4_FACT)>>8) |