Fix LED_GND
Update jd-c
This commit is contained in:
Michal Moskal 2021-01-06 12:48:16 +01:00
Родитель f73bb04344
Коммит 54df7b4a21
5 изменённых файлов: 7 добавлений и 29 удалений

Просмотреть файл

@ -10,14 +10,9 @@ static void start_app(void) {
ctx_t ctx_;
static const uint8_t output_pins[] = {OUTPUT_PINS};
void led_init(void) {
for (unsigned i = 0; i < sizeof(output_pins); ++i) {
pin_setup_output(output_pins[i]);
// all power pins are reverse polarity; we don't care much for others
pin_set(output_pins[i], 1);
}
pin_setup_output(PIN_LED);
pin_setup_output(PIN_LED_GND);
pin_set(PIN_LED_GND, 0);
}

@ -1 +1 @@
Subproject commit b391a37f38e2be8726e066b6dae94be30cf80f5f
Subproject commit c807db381f102981b2f61484e1a47e9e3bd4fd13

Просмотреть файл

@ -43,8 +43,4 @@
#define PIN_PWR -1
#endif
#ifndef OUTPUT_PINS
#define OUTPUT_PINS PIN_LED, PIN_LED_GND
#endif
#endif

Просмотреть файл

@ -4,14 +4,11 @@
uint32_t now;
static const uint8_t output_pins[] = {
OUTPUT_PINS, // per-board
PIN_LOG0, PIN_LOG1, PIN_LOG2, PIN_LOG3, // JD-impl logging
PIN_P0, PIN_P1, // application logging
PIN_LED, PIN_LED2, PIN_LED_GND, // LED
PIN_LOG0, PIN_LOG1, PIN_LOG2, PIN_LOG3, // JD-impl logging
PIN_P0, PIN_P1, // application logging
PIN_LED, PIN_LED2, PIN_LED_GND, // LED
};
static const uint8_t output_high_pins[] = {OUTPUT_PINS};
void led_init(void) {
// To save power, especially in STOP mode,
// configure all pins in GPIOA,B,C as analog inputs (except for SWD)
@ -30,14 +27,8 @@ void led_init(void) {
// setup all our output pins
for (unsigned i = 0; i < sizeof(output_pins); ++i)
pin_setup_output(output_pins[i]);
// make it consistent with bootloader
for (unsigned i = 0; i < sizeof(output_high_pins); ++i)
pin_set(output_high_pins[i], 1);
#ifdef PIN_GLO0
pin_set(PIN_GLO0, 1);
pin_set(PIN_GLO1, 1);
#endif
pin_set(PIN_LED_GND, 0);
}
void log_pin_set(int line, int v) {

Просмотреть файл

@ -31,10 +31,6 @@
#define UART_PIN PA_2
// #define UART_PIN PA_9
// These pins will be setup as output and set HIGH upon startup (of both bootloader and firmware).
// It's best not to rely on this.
// #define OUTPUT_PINS PA_6, PA_5
// Enable JACDAC Logger (console) service for debugging.
// #define JD_CONSOLE 1