Rev 2518 | Rev 2540 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2518 | Rev 2527 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | uint16_t LED2_Timing = 0; |
5 | uint16_t LED2_Timing = 0; |
6 | unsigned char J16Blinkcount = 0, J16Mask = 1; |
6 | unsigned char J16Blinkcount = 0, J16Mask = 1; |
7 | unsigned char J17Blinkcount = 0, J17Mask = 1; |
7 | unsigned char J17Blinkcount = 0, J17Mask = 1; |
8 | unsigned char NC_Wait_for_LED = 0; // signal to NC: Wait for the LAD PAtter before switching to the next WP |
8 | unsigned char NC_Wait_for_LED = 0; // signal to NC: Wait for the LAD PAtter before switching to the next WP |
9 | unsigned int ShutterCounter = 0; |
9 | unsigned int ShutterCounter = 0; |
10 | - | ||
- | 10 | unsigned char Out1ChangedFlag = 0; // can be 0 or 0x80 |
|
11 | // initializes the LED control outputs J16, J17 |
11 | // initializes the LED control outputs J16, J17 |
12 | void LED_Init(void) |
12 | void LED_Init(void) |
13 | { |
13 | { |
14 | // set PC2 & PC3 as output (control of J16 & J17) |
14 | // set PC2 & PC3 as output (control of J16 & J17) |
15 | DDRC |= (1<<DDC2)|(1<<DDC3); |
15 | DDRC |= (1<<DDC2)|(1<<DDC3); |
Line 127... | Line 127... | ||
127 | } |
127 | } |
Line 128... | Line 128... | ||
128 | 128 | ||
129 | 129 | ||
- | 130 | if(PORTC & (1<<PORTC2)) // output is on |
|
- | 131 | { |
|
- | 132 | if(!(last_portC & (1<<PORTC2))) |
|
130 | if(PORTC & (1<<PORTC2)) // output is on |
133 | { |
- | 134 | Out1ChangedFlag = 0x80;// this Flag marks a changed Out1; |
|
131 | { |
135 | ShutterCounter++; // count if output swiched to high |
132 | if(!(last_portC & (1<<PORTC2))) ShutterCounter++; // count if output swiched to high |
136 | } |
133 | FC_StatusFlags2 |= FC_STATUS2_OUT1_ACTIVE; //else FC_StatusFlags2 &= ~FC_STATUS2_OUT1_ACTIVE; // Out1 (J16) -> wird in der SPI zurück gesetzt |
137 | FC_StatusFlags2 |= FC_STATUS2_OUT1_ACTIVE; //else FC_StatusFlags2 &= ~FC_STATUS2_OUT1_ACTIVE; // Out1 (J16) -> wird in der SPI zurück gesetzt |
134 | } |
138 | } |
135 | if(PORTC & (1<<PORTC3)) FC_StatusFlags2 |= FC_STATUS2_OUT2_ACTIVE; else FC_StatusFlags2 &= ~FC_STATUS2_OUT2_ACTIVE; // Out2 (J17) |
139 | if(PORTC & (1<<PORTC3)) FC_StatusFlags2 |= FC_STATUS2_OUT2_ACTIVE; else FC_StatusFlags2 &= ~FC_STATUS2_OUT2_ACTIVE; // Out2 (J17) |