#include <main.h>
Functions | |
void | interrupt_init (void) |
void | init_ports (void) |
void | call_inits (void) |
void | bk_LED (int8_t value) |
Function to connect to property "Backlight brightness". | |
int | main (void) |
|
Function to connect to property "Backlight brightness". Form defined through the first function-pointer in struct menue_prop_struct in menu.h.
|
|
00042 { 00043 init_ports(); 00044 menu_init(); 00045 control_init(); 00046 input_init(); 00047 adc_init(0); 00048 disp_init(); 00049 usart_init(); 00050 interrupt_init(); 00051 }
|
|
|
Enables Timer2 for Backlight. Enables Timer3 for micro-second measurement. Enables interrupts globally. 00066 { 00067 //timer 2 in fast PWM for backlight 00068 PORTB &= ~(1<<PB7); 00069 DDRB |= (1<<PB7); //OC2 pin is output 00070 TCCR2 = (1<<WGM21) | (1<<WGM20) | (1<<COM21) | (1<<CS20); //no prescaler 00071 TCNT2 = 0; 00072 OCR2 = 108; //max 120 00073 00074 //timer 3 for us_timer 00075 us_timer_init(); 00076 00077 // enable interrupts 00078 sei(); 00079 }
|
|
Main, with test-code. 00097 { 00098 //#define cnt 1 00099 DDRE = (1<<PE2); //sets data direction for xck0 to output 00100 00101 call_inits(); 00102 #ifdef DISP_SPLASH 00103 for(uint32_t x=0; x < 5000000; x++) asm("nop"); 00104 #endif 00105 00106 while(1==1){ 00107 //uart_empfang(); 00108 control_refresh(); 00109 disp_refresh(); 00110 input_refresh(); 00111 } 00112 }
|