system76 / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
92 stars 33 forks source link

[Bug] Can't build system76/launch_lite_1:default -> ‘WS2812_DI_PIN’ undeclared #45

Open g-berthiaume opened 1 year ago

g-berthiaume commented 1 year ago

Describe the Bug

Hi, I'm not able to build my Launch lite's firmware.

Using WSL (Ubuntu 22), I followed the instructions here and it failed to build with the following error message:


$ make system76/launch_lite_1:default
QMK Firmware 0.21.0
Making system76/launch_lite_1 with keymap default

Generating: .build/obj_system76_launch_lite_1_default/src/info_deps.d
  [OK]
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Generating: .build/obj_system76_launch_lite_1/src/info_config.h
  [OK]
Generating: .build/obj_system76_launch_lite_1/src/default_keyboard.c
  [OK]
Generating: .build/obj_system76_launch_lite_1/src/default_keyboard.h
  [OK]
Compiling: keyboards/system76/system76_ec.c
  [OK]
Compiling: keyboards/system76/launch_lite_1/launch_lite_1.c
  [OK]
Compiling: .build/obj_system76_launch_lite_1/src/default_keyboard.c
  [OK]
Compiling: quantum/keymap_introspection.c
  [OK]
Compiling: quantum/quantum.c
  [OK]
Compiling: quantum/bitwise.c
  [OK]
Compiling: quantum/led.c
  [OK]
Compiling: quantum/action.c
  [OK]
Compiling: quantum/action_layer.c
  [OK]
Compiling: quantum/action_tapping.c
  [OK]
Compiling: quantum/action_util.c
  [OK]
Compiling: quantum/eeconfig.c
  [OK]
Compiling: quantum/keyboard.c
  [OK]
Compiling: quantum/keymap_common.c
  [OK]
Compiling: quantum/keycode_config.c
  [OK]
Compiling: quantum/sync_timer.c
  [OK]
Compiling: quantum/logging/debug.c
  [OK]
Compiling: quantum/logging/sendchar.c
  [OK]
Compiling: quantum/bootmagic/magic.c
  [OK]
Compiling: quantum/matrix_common.c
  [OK]
Compiling: quantum/matrix.c
  [OK]
Compiling: quantum/debounce/sym_defer_g.c
  [OK]
Compiling: quantum/main.c
  [OK]
Compiling: quantum/color.c
  [OK]
Compiling: quantum/rgb_matrix/rgb_matrix.c
  [OK]
Compiling: quantum/rgb_matrix/rgb_matrix_drivers.c
  [OK]
Compiling: lib/lib8tion/lib8tion.c
  [OK]
Compiling: quantum/process_keycode/process_rgb.c
  [OK]
Compiling: platforms/avr/drivers/ws2812_bitbang.c
 In file included from /usr/lib/avr/include/avr/io.h:99:0,
                 from /usr/lib/avr/include/avr/interrupt.h:38,
                 from platforms/avr/drivers/ws2812_bitbang.c:23:
platforms/avr/drivers/ws2812_bitbang.c: In function ‘ws2812_setleds’:
platforms/avr/drivers/ws2812_bitbang.c:41:18: error: ‘WS2812_DI_PIN’ undeclared (first use in this function)
     DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN);
                  ^
platforms/avr/_pin_defs.h:64:25: note: in expansion of macro ‘_PIN_ADDRESS’
 #define DDRx_ADDRESS(p) _PIN_ADDRESS(p, 1)
                         ^
platforms/avr/drivers/ws2812_bitbang.c:41:5: note: in expansion of macro ‘DDRx_ADDRESS’
     DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN);
     ^
platforms/avr/drivers/ws2812_bitbang.c:41:18: note: each undeclared identifier is reported only once for each function it appears in
     DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN);
                  ^
platforms/avr/_pin_defs.h:64:25: note: in expansion of macro ‘_PIN_ADDRESS’
 #define DDRx_ADDRESS(p) _PIN_ADDRESS(p, 1)
                         ^
platforms/avr/drivers/ws2812_bitbang.c:41:5: note: in expansion of macro ‘DDRx_ADDRESS’
     DDRx_ADDRESS(WS2812_DI_PIN) |= pinmask(WS2812_DI_PIN);
     ^
platforms/avr/drivers/ws2812_bitbang.c: In function ‘ws2812_sendarray_mask’:
platforms/avr/drivers/ws2812_bitbang.c:168:69: error: ‘WS2812_DI_PIN’ undeclared (first use in this function)
                      : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(WS2812_DI_PIN))), "r"(maskhi)                                                                     ^
platforms/avr/_pin_defs.h:66:26: note: in expansion of macro ‘_PIN_ADDRESS’
 #define PORTx_ADDRESS(p) _PIN_ADDRESS(p, 2)
                          ^
platforms/avr/drivers/ws2812_bitbang.c:168:55: note: in expansion of macro ‘PORTx_ADDRESS’
                      : "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(WS2812_DI_PIN))), "r"(maskhi)                                                       ^
 [ERRORS]
 |
 |
 |
make[1]: *** [builddefs/common_rules.mk:361: .build/obj_system76_launch_lite_1_default/ws2812_bitbang.o] Error 1
Make finished with errors

What would be the corrective actions?
Context: I decided to build QMK manually because the system76 configurator doesn't support some features (like macros).

Keyboard Used

make system76/launch_lite_1:default

Link to product page (if applicable)

launch_lite_1

Operating System

Linux (WSL)

qmk doctor Output

No response

Is AutoHotKey / Karabiner installed

Other keyboard-related software installed

No response

Additional Context

No response

jackpot51 commented 1 year ago

Should be fixed in #35

g-berthiaume commented 1 year ago

Hi @jackpot51, I'm not sure why PR #35 is called "Launch 3", but it appears to define the symbol missing in my compilation process. Thanks !

edit: I see you're the guy behind Redox OS. Pretty cool work. Keep it up !

jojo2357 commented 9 months ago

I had this issue on the launch 1 and fixed it by adding

  #ifdef RGB_MATRIX_ENABLE
  #    define RGB_DI_PIN F7
+ #    define WS2812_DI_PIN RGB_DI_PIN
g-berthiaume commented 9 months ago

Thanks for your comments, I will check this out in my christmas vacation.