From ecce9900c9cecfb095a9eb041af32eab26b44c1e Mon Sep 17 00:00:00 2001 From: Andrew Dunai Date: Tue, 31 May 2022 09:15:17 +0300 Subject: Improve PS/2 mouse performance (#17111) --- platforms/avr/drivers/ps2/ps2_usart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platforms/avr') diff --git a/platforms/avr/drivers/ps2/ps2_usart.c b/platforms/avr/drivers/ps2/ps2_usart.c index 39ec930d4a..581badac64 100644 --- a/platforms/avr/drivers/ps2/ps2_usart.c +++ b/platforms/avr/drivers/ps2/ps2_usart.c @@ -72,8 +72,8 @@ uint8_t ps2_error = PS2_ERR_NONE; static inline uint8_t pbuf_dequeue(void); static inline void pbuf_enqueue(uint8_t data); -static inline bool pbuf_has_data(void); static inline void pbuf_clear(void); +bool pbuf_has_data(void); void ps2_host_init(void) { idle(); // without this many USART errors occur when cable is disconnected @@ -212,7 +212,7 @@ static inline uint8_t pbuf_dequeue(void) { return val; } -static inline bool pbuf_has_data(void) { +bool pbuf_has_data(void) { uint8_t sreg = SREG; cli(); bool has_data = (pbuf_head != pbuf_tail); -- cgit v1.2.3 From e89478eb0fe582d1a30a882e278927e31c9cdcc7 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Mon, 6 Jun 2022 00:47:22 +0200 Subject: [Core] Update C standard to GNU11, C++ to GNU++14 (#17114) --- platforms/avr/platform.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platforms/avr') diff --git a/platforms/avr/platform.mk b/platforms/avr/platform.mk index 978199b385..b51a94c93a 100644 --- a/platforms/avr/platform.mk +++ b/platforms/avr/platform.mk @@ -38,7 +38,7 @@ CFLAGS += -fno-inline-small-functions CFLAGS += -fno-strict-aliasing CXXFLAGS += $(COMPILEFLAGS) -CXXFLAGS += -fno-exceptions -std=c++11 +CXXFLAGS += -fno-exceptions $(CXXSTANDARD) LDFLAGS += -Wl,--gc-sections -- cgit v1.2.3 From 608404f8742f01d1821a74c5a107e0c62b046423 Mon Sep 17 00:00:00 2001 From: Daniel Kao Date: Tue, 21 Jun 2022 15:00:04 -0700 Subject: Fix AVR I2C master 1ms timeout (#17174) * avr i2c_master: Fix 1ms timeout i2c_start() produces a minimum time_slice of 1ms for use as timeout value. The timer granularity is 1ms, it is entirely possible for timer_count to tick up immediately after the last timer read and falsely trigger timeout with a '>= 1' comparison. * avr/drivers/i2c_master: Use timer_elapsed() --- platforms/avr/drivers/i2c_master.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'platforms/avr') diff --git a/platforms/avr/drivers/i2c_master.c b/platforms/avr/drivers/i2c_master.c index c1a7b5f72d..524494c99d 100644 --- a/platforms/avr/drivers/i2c_master.c +++ b/platforms/avr/drivers/i2c_master.c @@ -64,7 +64,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -81,7 +81,7 @@ static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) { timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -102,7 +102,7 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout) { i2c_status_t status; do { status = i2c_start_impl(address, time_slice); - } while ((status < 0) && ((timeout == I2C_TIMEOUT_INFINITE) || (timer_elapsed(timeout_timer) < timeout))); + } while ((status < 0) && ((timeout == I2C_TIMEOUT_INFINITE) || (timer_elapsed(timeout_timer) <= timeout))); return status; } @@ -114,7 +114,7 @@ i2c_status_t i2c_write(uint8_t data, uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -132,7 +132,7 @@ int16_t i2c_read_ack(uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } @@ -147,7 +147,7 @@ int16_t i2c_read_nack(uint16_t timeout) { uint16_t timeout_timer = timer_read(); while (!(TWCR & (1 << TWINT))) { - if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) { + if ((timeout != I2C_TIMEOUT_INFINITE) && (timer_elapsed(timeout_timer) > timeout)) { return I2C_STATUS_TIMEOUT; } } -- cgit v1.2.3 From 7fd3d76faa92dd3291228e77533859793470683f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 25 Jun 2022 12:34:40 -0700 Subject: [Split] Ensure SOFT_SERIAL_PIN is defined if USE_I2C isn't defined (#17466) --- platforms/avr/drivers/serial.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platforms/avr') diff --git a/platforms/avr/drivers/serial.c b/platforms/avr/drivers/serial.c index 6a36aa5f7f..730d9b7a01 100644 --- a/platforms/avr/drivers/serial.c +++ b/platforms/avr/drivers/serial.c @@ -498,6 +498,10 @@ bool soft_serial_transaction(int sstd_index) { sei(); return true; } +#else +# ifndef USE_I2C +# error SOFT_SERIAL_PIN or USE_I2C is required but has not been defined. +# endif #endif // Helix serial.c history -- cgit v1.2.3 From d9bb189e25f14578ca74d6a3aa9f9a467f6f6595 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Thu, 7 Jul 2022 09:27:50 +0200 Subject: [Core] Update mpaland/printf to eyalroz/printf fork (#16163) mpaland printf implementation was abandoned in ~2019 and the fork by eyalroz is now regarded to be the goto replacement of it. So this commit incoporates the changes needed to use this fork in QMK. Note that pointer ptrdiff_t is always supported since commit 51c90f93a97fdaef895783ecbe24569be0db7cb8 --- platforms/avr/platform.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'platforms/avr') diff --git a/platforms/avr/platform.mk b/platforms/avr/platform.mk index b51a94c93a..39a11b28e4 100644 --- a/platforms/avr/platform.mk +++ b/platforms/avr/platform.mk @@ -24,6 +24,7 @@ COMPILEFLAGS += -fdata-sections COMPILEFLAGS += -fpack-struct COMPILEFLAGS += -fshort-enums COMPILEFLAGS += -mcall-prologues +COMPILEFLAGS += -fno-builtin-printf # Linker relaxation is only possible if # link time optimizations are not enabled. -- cgit v1.2.3 From ffb34fc0825e4a715842e93dbfdbe843759fec05 Mon Sep 17 00:00:00 2001 From: jack <0x6A73@pm.me> Date: Tue, 12 Jul 2022 13:55:19 -0600 Subject: Include stdint.h in avr/i2c_master.h (#17639) --- platforms/avr/drivers/i2c_master.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platforms/avr') diff --git a/platforms/avr/drivers/i2c_master.h b/platforms/avr/drivers/i2c_master.h index 2d95846db5..04ef126c80 100644 --- a/platforms/avr/drivers/i2c_master.h +++ b/platforms/avr/drivers/i2c_master.h @@ -19,6 +19,8 @@ #pragma once +#include + #define I2C_READ 0x01 #define I2C_WRITE 0x00 -- cgit v1.2.3 From 98d5c77521961fa19d0ff81e941e78997d96dfb0 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 31 Jul 2022 22:15:01 +0100 Subject: Remove legacy AVR ssd1306 driver (#17864) --- platforms/avr/drivers/ssd1306.c | 329 ---------------------------------------- platforms/avr/drivers/ssd1306.h | 87 ----------- 2 files changed, 416 deletions(-) delete mode 100644 platforms/avr/drivers/ssd1306.c delete mode 100644 platforms/avr/drivers/ssd1306.h (limited to 'platforms/avr') diff --git a/platforms/avr/drivers/ssd1306.c b/platforms/avr/drivers/ssd1306.c deleted file mode 100644 index 7afbc09f00..0000000000 --- a/platforms/avr/drivers/ssd1306.c +++ /dev/null @@ -1,329 +0,0 @@ -#ifdef SSD1306OLED - -# include "ssd1306.h" -# include "i2c.h" -# include -# include "print.h" -# include "glcdfont.c" -# ifdef PROTOCOL_LUFA -# include "lufa.h" -# endif -# include "sendchar.h" -# include "timer.h" - -struct CharacterMatrix display; - -// Set this to 1 to help diagnose early startup problems -// when testing power-on with ble. Turn it off otherwise, -// as the latency of printing most of the debug info messes -// with the matrix scan, causing keys to drop. -# define DEBUG_TO_SCREEN 0 - -// static uint16_t last_battery_update; -// static uint32_t vbat; -//#define BatteryUpdateInterval 10000 /* milliseconds */ -# define ScreenOffInterval 300000 /* milliseconds */ -# if DEBUG_TO_SCREEN -static uint8_t displaying; -# endif -static uint16_t last_flush; - -// Write command sequence. -// Returns true on success. -static inline bool _send_cmd1(uint8_t cmd) { - bool res = false; - - if (i2c_start_write(SSD1306_ADDRESS)) { - xprintf("failed to start write to %d\n", SSD1306_ADDRESS); - goto done; - } - - if (i2c_master_write(0x0 /* command byte follows */)) { - print("failed to write control byte\n"); - - goto done; - } - - if (i2c_master_write(cmd)) { - xprintf("failed to write command %d\n", cmd); - goto done; - } - res = true; -done: - i2c_master_stop(); - return res; -} - -// Write 2-byte command sequence. -// Returns true on success -static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { - if (!_send_cmd1(cmd)) { - return false; - } - return _send_cmd1(opr); -} - -// Write 3-byte command sequence. -// Returns true on success -static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { - if (!_send_cmd1(cmd)) { - return false; - } - if (!_send_cmd1(opr1)) { - return false; - } - return _send_cmd1(opr2); -} - -# define send_cmd1(c) \ - if (!_send_cmd1(c)) { \ - goto done; \ - } -# define send_cmd2(c, o) \ - if (!_send_cmd2(c, o)) { \ - goto done; \ - } -# define send_cmd3(c, o1, o2) \ - if (!_send_cmd3(c, o1, o2)) { \ - goto done; \ - } - -static void clear_display(void) { - matrix_clear(&display); - - // Clear all of the display bits (there can be random noise - // in the RAM on startup) - send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); - send_cmd3(ColumnAddr, 0, DisplayWidth - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < DisplayWidth; ++col) { - i2c_master_write(0); - } - } - - display.dirty = false; - -done: - i2c_master_stop(); -} - -# if DEBUG_TO_SCREEN -# undef sendchar -static int8_t capture_sendchar(uint8_t c) { - sendchar(c); - iota_gfx_write_char(c); - - if (!displaying) { - iota_gfx_flush(); - } - return 0; -} -# endif - -bool iota_gfx_init(void) { - bool success = false; - - send_cmd1(DisplayOff); - send_cmd2(SetDisplayClockDiv, 0x80); - send_cmd2(SetMultiPlex, DisplayHeight - 1); - - send_cmd2(SetDisplayOffset, 0); - - send_cmd1(SetStartLine | 0x0); - send_cmd2(SetChargePump, 0x14 /* Enable */); - send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); - -# ifdef OLED_ROTATE180 - // the following Flip the display orientation 180 degrees - send_cmd1(SegRemap); - send_cmd1(ComScanInc); -# endif -# ifndef OLED_ROTATE180 - // Flips the display orientation 0 degrees - send_cmd1(SegRemap | 0x1); - send_cmd1(ComScanDec); -# endif - - send_cmd2(SetComPins, 0x2); - send_cmd2(SetContrast, 0x8f); - send_cmd2(SetPreCharge, 0xf1); - send_cmd2(SetVComDetect, 0x40); - send_cmd1(DisplayAllOnResume); - send_cmd1(NormalDisplay); - send_cmd1(DeActivateScroll); - send_cmd1(DisplayOn); - - send_cmd2(SetContrast, 0); // Dim - - clear_display(); - - success = true; - - iota_gfx_flush(); - -# if DEBUG_TO_SCREEN - print_set_sendchar(capture_sendchar); -# endif - -done: - return success; -} - -bool iota_gfx_off(void) { - bool success = false; - - send_cmd1(DisplayOff); - success = true; - -done: - return success; -} - -bool iota_gfx_on(void) { - bool success = false; - - send_cmd1(DisplayOn); - success = true; - -done: - return success; -} - -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { - *matrix->cursor = c; - ++matrix->cursor; - - if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { - // We went off the end; scroll the display upwards by one line - memmove(&matrix->display[0], &matrix->display[1], MatrixCols * (MatrixRows - 1)); - matrix->cursor = &matrix->display[MatrixRows - 1][0]; - memset(matrix->cursor, ' ', MatrixCols); - } -} - -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { - matrix->dirty = true; - - if (c == '\n') { - // Clear to end of line from the cursor and then move to the - // start of the next line - uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; - - while (cursor_col++ < MatrixCols) { - matrix_write_char_inner(matrix, ' '); - } - return; - } - - matrix_write_char_inner(matrix, c); -} - -void iota_gfx_write_char(uint8_t c) { - matrix_write_char(&display, c); -} - -void matrix_write(struct CharacterMatrix *matrix, const char *data) { - const char *end = data + strlen(data); - while (data < end) { - matrix_write_char(matrix, *data); - ++data; - } -} - -void iota_gfx_write(const char *data) { - matrix_write(&display, data); -} - -void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { - while (true) { - uint8_t c = pgm_read_byte(data); - if (c == 0) { - return; - } - matrix_write_char(matrix, c); - ++data; - } -} - -void iota_gfx_write_P(const char *data) { - matrix_write_P(&display, data); -} - -void matrix_clear(struct CharacterMatrix *matrix) { - memset(matrix->display, ' ', sizeof(matrix->display)); - matrix->cursor = &matrix->display[0][0]; - matrix->dirty = true; -} - -void iota_gfx_clear_screen(void) { - matrix_clear(&display); -} - -void matrix_render(struct CharacterMatrix *matrix) { - last_flush = timer_read(); - iota_gfx_on(); -# if DEBUG_TO_SCREEN - ++displaying; -# endif - - // Move to the home position - send_cmd3(PageAddr, 0, MatrixRows - 1); - send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < MatrixCols; ++col) { - const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1)); - - for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) { - uint8_t colBits = pgm_read_byte(glyph + glyphCol); - i2c_master_write(colBits); - } - - // 1 column of space between chars (it's not included in the glyph) - i2c_master_write(0); - } - } - - matrix->dirty = false; - -done: - i2c_master_stop(); -# if DEBUG_TO_SCREEN - --displaying; -# endif -} - -void iota_gfx_flush(void) { - matrix_render(&display); -} - -__attribute__((weak)) void iota_gfx_task_user(void) {} - -void iota_gfx_task(void) { - iota_gfx_task_user(); - - if (display.dirty) { - iota_gfx_flush(); - } - - if (timer_elapsed(last_flush) > ScreenOffInterval) { - iota_gfx_off(); - } -} -#endif diff --git a/platforms/avr/drivers/ssd1306.h b/platforms/avr/drivers/ssd1306.h deleted file mode 100644 index 6eecdcfaa4..0000000000 --- a/platforms/avr/drivers/ssd1306.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include -#include -#include "config.h" - -enum ssd1306_cmds { - DisplayOff = 0xAE, - DisplayOn = 0xAF, - - SetContrast = 0x81, - DisplayAllOnResume = 0xA4, - - DisplayAllOn = 0xA5, - NormalDisplay = 0xA6, - InvertDisplay = 0xA7, - SetDisplayOffset = 0xD3, - SetComPins = 0xda, - SetVComDetect = 0xdb, - SetDisplayClockDiv = 0xD5, - SetPreCharge = 0xd9, - SetMultiPlex = 0xa8, - SetLowColumn = 0x00, - SetHighColumn = 0x10, - SetStartLine = 0x40, - - SetMemoryMode = 0x20, - ColumnAddr = 0x21, - PageAddr = 0x22, - - ComScanInc = 0xc0, - ComScanDec = 0xc8, - SegRemap = 0xa0, - SetChargePump = 0x8d, - ExternalVcc = 0x01, - SwitchCapVcc = 0x02, - - ActivateScroll = 0x2f, - DeActivateScroll = 0x2e, - SetVerticalScrollArea = 0xa3, - RightHorizontalScroll = 0x26, - LeftHorizontalScroll = 0x27, - VerticalAndRightHorizontalScroll = 0x29, - VerticalAndLeftHorizontalScroll = 0x2a, -}; - -// Controls the SSD1306 128x32 OLED display via i2c - -#ifndef SSD1306_ADDRESS -# define SSD1306_ADDRESS 0x3C -#endif - -#define DisplayHeight 32 -#define DisplayWidth 128 - -#define FontHeight 8 -#define FontWidth 6 - -#define MatrixRows (DisplayHeight / FontHeight) -#define MatrixCols (DisplayWidth / FontWidth) - -struct CharacterMatrix { - uint8_t display[MatrixRows][MatrixCols]; - uint8_t *cursor; - bool dirty; -}; - -extern struct CharacterMatrix display; - -bool iota_gfx_init(void); -void iota_gfx_task(void); -bool iota_gfx_off(void); -bool iota_gfx_on(void); -void iota_gfx_flush(void); -void iota_gfx_write_char(uint8_t c); -void iota_gfx_write(const char *data); -void iota_gfx_write_P(const char *data); -void iota_gfx_clear_screen(void); - -void iota_gfx_task_user(void); - -void matrix_clear(struct CharacterMatrix *matrix); -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write(struct CharacterMatrix *matrix, const char *data); -void matrix_write_P(struct CharacterMatrix *matrix, const char *data); -void matrix_render(struct CharacterMatrix *matrix); -- cgit v1.2.3 From a83afb3fcd741d0de391f21196ea79066fe88076 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sun, 14 Aug 2022 08:04:03 +0900 Subject: Improve avr wait_us() (#16879) --- platforms/avr/_wait.h | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'platforms/avr') diff --git a/platforms/avr/_wait.h b/platforms/avr/_wait.h index 683db6ae57..c1a598a428 100644 --- a/platforms/avr/_wait.h +++ b/platforms/avr/_wait.h @@ -17,6 +17,26 @@ #include +// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf +// page 22: Table 4-2. Arithmetic and Logic Instructions +/* + for (uint16_t i = times; i > 0; i--) { + __builtin_avr_delay_cycles(1); + } + + .L3: sbiw r24,0 // loop step 1 + brne .L4 // loop step 2 + ret + .L4: nop // __builtin_avr_delay_cycles(1); + sbiw r24,1 // loop step 3 + rjmp .L3 // loop step 4 +*/ + +#define AVR_sbiw_clocks 2 +#define AVR_rjmp_clocks 2 +#define AVR_brne_clocks 2 +#define AVR_WAIT_LOOP_OVERHEAD (AVR_sbiw_clocks + AVR_brne_clocks + AVR_sbiw_clocks + AVR_rjmp_clocks) + #define wait_ms(ms) \ do { \ if (__builtin_constant_p(ms)) { \ @@ -27,15 +47,15 @@ } \ } \ } while (0) -#define wait_us(us) \ - do { \ - if (__builtin_constant_p(us)) { \ - _delay_us(us); \ - } else { \ - for (uint16_t i = us; i > 0; i--) { \ - _delay_us(1); \ - } \ - } \ +#define wait_us(us) \ + do { \ + if (__builtin_constant_p(us)) { \ + _delay_us(us); \ + } else { \ + for (uint16_t i = us; i > 0; i--) { \ + __builtin_avr_delay_cycles((F_CPU / 1000000) - AVR_WAIT_LOOP_OVERHEAD); \ + } \ + } \ } while (0) #define wait_cpuclock(n) __builtin_avr_delay_cycles(n) #define CPU_CLOCK F_CPU -- cgit v1.2.3 From cc1565f2a3e46f6f364f872962ced35aef5ddae8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 3 Oct 2022 12:26:04 +1100 Subject: `:flash`: print bootloader (#18569) --- platforms/avr/flash.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platforms/avr') diff --git a/platforms/avr/flash.mk b/platforms/avr/flash.mk index 6d50e72534..c104f730b3 100644 --- a/platforms/avr/flash.mk +++ b/platforms/avr/flash.mk @@ -168,7 +168,8 @@ endef hid_bootloader: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware $(call EXEC_HID_LUFA) -flash: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware +flash: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(SILENT) || printf "Flashing for bootloader: $(BLUE)$(BOOTLOADER)$(NO_COLOR)\n" ifneq ($(strip $(PROGRAM_CMD)),) $(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD) else ifeq ($(strip $(BOOTLOADER)), caterina) -- cgit v1.2.3 From 96c48a5f4aa461ed31fd4ee61151ac206e16fb5f Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 31 Oct 2022 20:16:43 +0000 Subject: Refactor to avoid deprecated wmic execution (#18122) * wmic deprecated? * Update platforms/avr/flash.mk * Update platforms/avr/flash.mk --- platforms/avr/flash.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platforms/avr') diff --git a/platforms/avr/flash.mk b/platforms/avr/flash.mk index c104f730b3..e058e8d296 100644 --- a/platforms/avr/flash.mk +++ b/platforms/avr/flash.mk @@ -78,7 +78,7 @@ AVRDUDE_PROGRAMMER ?= avrdude define EXEC_AVRDUDE list_devices() { \ if $(GREP) -q -s icrosoft /proc/version; then \ - wmic.exe path Win32_SerialPort get DeviceID 2>/dev/null | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | xargs echo -n | sort; \ + powershell.exe 'Get-CimInstance -Class Win32_SerialPort | Select -ExpandProperty "DeviceID"' 2>/dev/null | sed -e "s/\r//g" | LANG=C perl -pne 's/COM(\d+)/COM.($$1-1)/e' | sed 's!COM!/dev/ttyS!' | sort; \ elif [ "`uname`" = "FreeBSD" ]; then \ ls /dev/tty* | grep -v '\.lock$$' | grep -v '\.init$$'; \ else \ -- cgit v1.2.3