~toykeeper/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to ToyKeeper/hwdef-Emisar_D4Sv2-tintramp.h

  • Committer: Selene ToyKeeper
  • Date: 2021-11-03 08:42:12 UTC
  • Revision ID: bzr@toykeeper.net-20211103084212-8iu694vxky9vkq3k
added KR4-tintramp build
(is basically identical to D4Sv2-tintramp, but with the switch on a different pin,
 and no button LED)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
#define SWITCH_PCIE  PCIE0   // PCIE1 is for PCINT[7:0]
53
53
#define SWITCH_PCMSK PCMSK0  // PCMSK1 is for PCINT[7:0]
54
54
#define SWITCH_PORT  PINA    // PINA or PINB or PINC
 
55
#define SWITCH_PUE   PUEA    // pullup group A
55
56
#define PCINT_vect   PCINT0_vect  // ISR for PCINT[7:0]
56
57
 
57
58
// usually PWM1_LVL would be a hardware register, but we need to abstract
173
174
  PWM1_TOP = PWM_TOP;
174
175
 
175
176
  // set up e-switch
176
 
  PUEA = (1 << SWITCH_PIN);  // pull-up for e-switch
 
177
  SWITCH_PUE = (1 << SWITCH_PIN);  // pull-up for e-switch
177
178
  SWITCH_PCMSK = (1 << SWITCH_PCINT);  // enable pin change interrupt
178
179
}
179
180