diff options
author | William Harrington <kb0iic@berzerkula.org> | 2019-08-07 22:52:55 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2019-08-07 22:52:55 -0500 |
commit | b2325f38a1b65f27ba804587800df91214bca02f (patch) | |
tree | ae875a5a48bf8c51cdb37689be1114c614024c4f | |
parent | 46329a7559e0c6ab10d1ca56aa1798fb05ad000e (diff) |
Tidy up ifdef blocks for VFD and ADC.
-rwxr-xr-x | main.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -25,6 +25,15 @@ unsigned int date = 0; unsigned int month = 0;
unsigned int year = 00;
unsigned int century = 20;
+unsigned int alarm1_sec = 0;
+unsigned int alarm1_min = 0;
+unsigned int alarm1_hour = 0;
+unsigned int alarm2_min = 0;
+unsigned int alarm2_hour = 0;
+unsigned int status_reg = 0;
+unsigned int alarm1_status = 0;
+unsigned int alarm2_status = 0;
+unsigned int control_reg = 0;
// Initialize variables for temperature
unsigned int temperature_lsb = 0;
@@ -32,7 +41,9 @@ int temperature_msb = 0; unsigned char temp_sign = ' ';
void main(void) {
+#ifdef ADC
TRISA0 = 0x01; // RA is input (ADC)
+#endif
TRISBbits.TRISB2 = 1;
TRISBbits.TRISB4 = 1;
TRISBbits.TRISB5 = 1;
@@ -84,7 +95,7 @@ void main(void) { #endif
#ifdef VFD
- Vfd_Set_Brightness(0); //Max brightness 3 - minimum
+ Vfd_Set_Brightness(0); // Maximum 0 - Minimum 3
#endif
display_Intro();
@@ -137,6 +148,7 @@ void main(void) { }
#ifdef ADC
+ #ifdef VFD
// Get current LDR reading and calculate for brightness levels 0 - 3
ldr = Adc_Read(0);
@@ -144,6 +156,7 @@ void main(void) { Vfd_Set_Brightness(brtlvl);
brtlvl_chg = brtlvl;
}
+ #endif
#endif
#ifdef DEBUG
|