diff options
| author | Selene ToyKeeper | 2020-07-06 14:24:28 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-07-06 14:24:28 -0600 |
| commit | 24270b394a0119bff8681ed75c1e21876c11439f (patch) | |
| tree | 432756e4b5bf26bac78c7809128d52e0d531262c /hwdef-Emisar_D4v2.h | |
| parent | added a compile flag to fix compatibility with GCC 7/8/9's new semantics for ... (diff) | |
| parent | merged in support for Noctigon K1-SBT90.2 (diff) | |
| download | anduril-24270b394a0119bff8681ed75c1e21876c11439f.tar.gz anduril-24270b394a0119bff8681ed75c1e21876c11439f.tar.bz2 anduril-24270b394a0119bff8681ed75c1e21876c11439f.zip | |
merged nearly a year of updates from the fsm branch, including the new product map
Diffstat (limited to 'hwdef-Emisar_D4v2.h')
| -rw-r--r-- | hwdef-Emisar_D4v2.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/hwdef-Emisar_D4v2.h b/hwdef-Emisar_D4v2.h index 0460fad..fc95e22 100644 --- a/hwdef-Emisar_D4v2.h +++ b/hwdef-Emisar_D4v2.h @@ -9,7 +9,7 @@ * 3 PA4 green aux LED * 4 PA3 blue aux LED * 5 PA2 e-switch - * 6 PA1 (none) + * 6 PA1 button LED * 7 PA0 (none) * 8 GND GND * 9 VCC VCC @@ -48,15 +48,13 @@ #define PWM2_LVL OCR1B // OCR1B is the output compare register for PB1 -#define ADC_PRSCL 0x06 // clk/64 +#define ADC_PRSCL 0x07 // clk/128 // average drop across diode on this hardware #ifndef VOLTAGE_FUDGE_FACTOR #define VOLTAGE_FUDGE_FACTOR 4 // add 0.20V (measured 0.22V) #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 @@ -65,17 +63,23 @@ #define AUXLED_RGB_DDR DDRA // DDRA or DDRB or DDRC #define AUXLED_RGB_PUE PUEA // PUEA or PUEB or PUEC +#define BUTTON_LED_PIN PA1 // pin 6 +#define BUTTON_LED_PORT PORTA // for all "PA" pins +#define BUTTON_LED_DDR DDRA // for all "PA" pins +#define BUTTON_LED_PUE PUEA // for all "PA" pins + // with so many pins, doing this all with #ifdefs gets awkward... // ... so just hardcode it in each hwdef file instead inline void hwdef_setup() { // enable output ports // 7135 DDRB = (1 << PWM1_PIN); - // FET, aux R/G/B + // FET, aux R/G/B, button LED DDRA = (1 << PWM2_PIN) | (1 << AUXLED_R_PIN) | (1 << AUXLED_G_PIN) | (1 << AUXLED_B_PIN) + | (1 << BUTTON_LED_PIN) ; // configure PWM |
