From 688387a75413fe8213ac1bf1458176ddaa7df0ae Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 27 Apr 2023 04:26:03 -0600 Subject: Noctigon KR4-tintramp updated to use new channel system (was easy since it just uses the generic Emisar-2ch build with a couple small overrides) --- hwdef-Noctigon_KR4-tintramp.h | 47 ---------------------- hwdef-noctigon-kr4-2ch.h | 47 ++++++++++++++++++++++ spaghetti-monster/anduril/cfg-noctigon-kr4-2ch.h | 16 ++++++++ .../anduril/cfg-noctigon-kr4-tintramp.h | 16 -------- 4 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 hwdef-Noctigon_KR4-tintramp.h create mode 100644 hwdef-noctigon-kr4-2ch.h create mode 100644 spaghetti-monster/anduril/cfg-noctigon-kr4-2ch.h delete mode 100644 spaghetti-monster/anduril/cfg-noctigon-kr4-tintramp.h diff --git a/hwdef-Noctigon_KR4-tintramp.h b/hwdef-Noctigon_KR4-tintramp.h deleted file mode 100644 index 78a4d6b..0000000 --- a/hwdef-Noctigon_KR4-tintramp.h +++ /dev/null @@ -1,47 +0,0 @@ -// Noctigon KR4 w/ tint ramping -// Copyright (C) 2021-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -/* - * (same driver as D4Sv2-tintramp, but with the switch on a different pin) - * - * Pin / Name / Function - * 1 PA6 2nd LED PWM (linear) (PWM1B) - * 2 PA5 R: red aux LED (PWM0B) - * 3 PA4 G: green aux LED - * 4 PA3 B: blue aux LED - * 5 PA2 button LED - * 6 PA1 Opamp 2 enable (2nd LEDs) - * 7 PA0 Opamp 1 enable (main LEDs) - * 8 GND GND - * 9 VCC VCC - * 10 PC5 (none) - * 11 PC4 (none) - * 12 PC3 RESET - * 13 PC2 (none) - * 14 PC1 SCK - * 15 PC0 main LED PWM (FET) (PWM0A) (unused on some models because tint ramping) - * 16 PB3 main LED PWM (linear) (PWM1A) - * 17 PB2 MISO / e-switch (PCINT10) - * 18 PB1 MOSI / battery voltage (ADC6) - * 19 PB0 (none) - * 20 PA7 (none) - * ADC12 thermal sensor - */ - -#define ATTINY 1634 -#include - -// move the switch to a different pin -#define SWITCH_PIN PB2 // pin 17 -#define SWITCH_PCINT PCINT10 // pin 17 pin change interrupt -#define SWITCH_PCIE PCIE1 // PCIE1 is for PCINT[11:8] -#define SWITCH_PCMSK PCMSK1 // PCMSK1 is for PCINT[11:8] -#define SWITCH_PORT PINB // PINA or PINB or PINC -#define SWITCH_PUE PUEB // pullup group B -#define PCINT_vect PCINT1_vect // ISR for PCINT[11:8] - -// the rest of the config is the same as D4Sv2-tintramp -#include "hwdef-Emisar_D4Sv2-tintramp.h" - diff --git a/hwdef-noctigon-kr4-2ch.h b/hwdef-noctigon-kr4-2ch.h new file mode 100644 index 0000000..a450693 --- /dev/null +++ b/hwdef-noctigon-kr4-2ch.h @@ -0,0 +1,47 @@ +// Noctigon KR4 w/ tint ramping +// Copyright (C) 2021-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +/* + * (same driver as emisar-2ch, but with the switch on a different pin) + * + * Pin / Name / Function + * 1 PA6 2nd LED PWM (linear) (PWM1B) + * 2 PA5 R: red aux LED (PWM0B) + * 3 PA4 G: green aux LED + * 4 PA3 B: blue aux LED + * 5 PA2 button LED + * 6 PA1 Opamp 2 enable (2nd LEDs) + * 7 PA0 Opamp 1 enable (main LEDs) + * 8 GND GND + * 9 VCC VCC + * 10 PC5 (none) + * 11 PC4 (none) + * 12 PC3 RESET + * 13 PC2 (none) + * 14 PC1 SCK + * 15 PC0 main LED PWM (FET) (PWM0A) (unused on some models because tint ramping) + * 16 PB3 main LED PWM (linear) (PWM1A) + * 17 PB2 MISO / e-switch (PCINT10) + * 18 PB1 MOSI / battery voltage (ADC6) + * 19 PB0 (none) + * 20 PA7 (none) + * ADC12 thermal sensor + */ + +#define ATTINY 1634 +#include + +// move the switch to a different pin +#define SWITCH_PIN PB2 // pin 17 +#define SWITCH_PCINT PCINT10 // pin 17 pin change interrupt +#define SWITCH_PCIE PCIE1 // PCIE1 is for PCINT[11:8] +#define SWITCH_PCMSK PCMSK1 // PCMSK1 is for PCINT[11:8] +#define SWITCH_PORT PINB // PINA or PINB or PINC +#define SWITCH_PUE PUEB // pullup group B +#define PCINT_vect PCINT1_vect // ISR for PCINT[11:8] + +// the rest of the config is the same as the generic Emisar 2ch build +#include "hwdef-emisar-2ch.h" + diff --git a/spaghetti-monster/anduril/cfg-noctigon-kr4-2ch.h b/spaghetti-monster/anduril/cfg-noctigon-kr4-2ch.h new file mode 100644 index 0000000..09dd604 --- /dev/null +++ b/spaghetti-monster/anduril/cfg-noctigon-kr4-2ch.h @@ -0,0 +1,16 @@ +// Noctigon KR4 2-channel config options for Anduril +// Copyright (C) 2021-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +// (basically the same as Emisar generic 2-channel build, +// but switch on a different pin, and no lighted button) +// ATTINY: 1634 +#include "hwdef-noctigon-kr4-2ch.h" +#include "cfg-emisar-2ch.h" +#undef MODEL_NUMBER +#define MODEL_NUMBER "0215" + +// the button doesn't light up +#undef USE_BUTTON_LED + diff --git a/spaghetti-monster/anduril/cfg-noctigon-kr4-tintramp.h b/spaghetti-monster/anduril/cfg-noctigon-kr4-tintramp.h deleted file mode 100644 index c36df47..0000000 --- a/spaghetti-monster/anduril/cfg-noctigon-kr4-tintramp.h +++ /dev/null @@ -1,16 +0,0 @@ -// Noctigon KR4 tint-ramping config options for Anduril -// Copyright (C) 2021-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -// (basically the same as Emisar D4S V2 tint-ramping, -// but switch on a different pin, and no lighted button) -// ATTINY: 1634 -#include "hwdef-Noctigon_KR4-tintramp.h" -#include "cfg-emisar-d4sv2-tintramp.h" -#undef MODEL_NUMBER -#define MODEL_NUMBER "0215" - -// the button doesn't light up -#undef USE_BUTTON_LED - -- cgit v1.2.3