Rev 1607 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1607 | Rev 1610 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include <inttypes.h> |
1 | #include <inttypes.h> |
2 | #include "main.h" |
2 | #include "main.h" |
Line -... | Line 3... | ||
- | 3 | ||
- | 4 | #define PHOTO_MODE_DELAY 2000/10 |
|
- | 5 | #define PHOTO_MODE_TRIGGER_TIME 1000/10 |
|
- | 6 | #define PHOTO_MODE_TRIGGER_PERIOD 4000/10 |
|
3 | 7 | ||
4 | uint16_t LED1_Timing = 0; |
8 | uint16_t LED1_Timing = 0; |
5 | uint16_t LED2_Timing = 0; |
9 | uint16_t LED2_Timing = 0; |
6 | unsigned char J16Blinkcount = 0, J16Mask = 1; |
10 | unsigned char J16Blinkcount = 0, J16Mask = 1; |
Line -... | Line 11... | ||
- | 11 | unsigned char J17Blinkcount = 0, J17Mask = 1; |
|
- | 12 | ||
- | 13 | uint8_t PhotoModeDelayCounter ; |
|
- | 14 | uint16_t PhotoModelCounter; |
|
- | 15 | ||
- | 16 | ||
7 | unsigned char J17Blinkcount = 0, J17Mask = 1; |
17 | |
8 | 18 | ||
9 | // initializes the LED control outputs J16, J17 |
19 | // initializes the LED control outputs J16, J17 |
10 | void LED_Init(void) |
20 | void LED_Init(void) |
11 | { |
21 | { |
Line 26... | Line 36... | ||
26 | { |
36 | { |
27 | delay = 4; |
37 | delay = 4; |
Line 28... | Line 38... | ||
28 | 38 | ||
29 | if (Parameter_J16Timing < 10) |
39 | if (Parameter_J16Timing < 10) |
- | 40 | { |
|
30 | { |
41 | // Low: select camera 1 |
31 | J16_OFF; |
42 | J16_OFF; |
32 | J17_OFF; |
43 | J17_OFF; |
33 | } |
44 | } |
34 | else if (Parameter_J16Timing < 180) |
45 | else if (Parameter_J16Timing < 180) |
- | 46 | { |
|
35 | { |
47 | // Middle: select camera 2, no trigger |
36 | J16_ON; |
48 | J16_ON; |
- | 49 | J17_OFF; |
|
- | 50 | PhotoModeDelayCounter = PHOTO_MODE_DELAY; |
|
37 | J17_OFF; |
51 | PhotoModelCounter = 0; |
38 | } |
52 | } |
39 | else |
53 | else |
- | 54 | { |
|
40 | { |
55 | // High: select camera 2 and trigger |
- | 56 | J16_ON; |
|
- | 57 | ||
- | 58 | if (PhotoModeDelayCounter) |
|
- | 59 | { |
|
- | 60 | // Not in photo-mode (yet) |
|
41 | J16_ON; |
61 | PhotoModeDelayCounter--; |
- | 62 | J17_ON; |
|
- | 63 | } |
|
- | 64 | else |
|
- | 65 | { |
|
- | 66 | PhotoModelCounter++; |
|
- | 67 | ||
- | 68 | // In photo-mode |
|
- | 69 | if (PhotoModelCounter < PHOTO_MODE_TRIGGER_TIME) |
|
- | 70 | { |
|
- | 71 | J17_ON; |
|
- | 72 | } |
|
- | 73 | else if (PhotoModelCounter < PHOTO_MODE_TRIGGER_PERIOD-PHOTO_MODE_TRIGGER_TIME) |
|
- | 74 | { |
|
- | 75 | J17_OFF; |
|
- | 76 | } |
|
- | 77 | else |
|
- | 78 | { |
|
- | 79 | PhotoModelCounter = 0; |
|
- | 80 | } |
|
- | 81 | } |
|
42 | J17_ON; |
82 | |
43 | } |
83 | } |
44 | } |
84 | } |