qmk / qmk_firmware

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

[Bug] custom firmware compiling for doio kb28 keeps giving errors with quantum/encoder.h and quantum/util.h #24270

Closed Nebula-0-System closed 1 month ago

Nebula-0-System commented 1 month ago

Describe the Bug

i'm trying to compile custom firmware for the doio kb28 and i'm struggling as it's giving me constant trouble, namely with files in the quantum folder, which i feel shouldn't be happening, as those are core files that i feel i shouldn't have to edit to make this work. that said, i am having a hard time understanding what i'm looking at as this is my first try, so maybe i'm just doing something totally wrong.

the output i'm getting is as follows

Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=kb28 KEYMAP=aleena KEYBOARD_FILESAFE=kb28 TARGET=kb28_aleena INTERMEDIATE_OUTPUT=.build/obj_kb28_aleena VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk"

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.

Compiling: .build/obj_kb28_aleena/src/default_keyboard.c                                           In file included from tmk_core/protocol/report.h:23:0,
                 from tmk_core/protocol/host.h:22,
                 from quantum/quantum.h:49,
                 from ./.build/obj_kb28_aleena/src/default_keyboard.h:27,
                 from .build/obj_kb28_aleena/src/default_keyboard.c:26:
./keyboards/kb28/config.h:33:30: error: ‘A5’ undeclared here (not in a function)
 #define ENCODERS_PAD_A { B5, A5, A3 }
                              ^
quantum/util.h:18:32: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/util.h:47:54: note: in expansion of macro ‘IS_ARRAY’
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                                      ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:61:55: note: in expansion of macro ‘ENCODERS_PAD_A’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                                       ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
./keyboards/kb28/config.h:33:34: error: ‘A3’ undeclared here (not in a function)
 #define ENCODERS_PAD_A { B5, A5, A3 }
                                  ^
quantum/util.h:18:32: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/util.h:47:54: note: in expansion of macro ‘IS_ARRAY’
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                                      ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:61:55: note: in expansion of macro ‘ENCODERS_PAD_A’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                                       ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
quantum/util.h:47:32: error: first argument to ‘__builtin_choose_expr’ not a constant
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                ^
quantum/util.h:18:32: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
quantum/util.h:47:32: error: first argument to ‘__builtin_choose_expr’ not a constant
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                ^
quantum/util.h:18:32: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
quantum/util.h:47:32: error: first argument to ‘__builtin_choose_expr’ not a constant
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                ^
quantum/util.h:18:45: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                             ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
quantum/util.h:47:32: error: first argument to ‘__builtin_choose_expr’ not a constant
 #    define ARRAY_SIZE(array) (__builtin_choose_expr(IS_ARRAY((array)), sizeof((array)) / sizeof((array)[0]), (void)0))
                                ^
quantum/util.h:18:45: note: in definition of macro ‘MAX’
 #    define MAX(x, y) (((x) > (y)) ? (x) : (y))
                                             ^
quantum/encoder.h:74:39: note: in expansion of macro ‘MAX’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                       ^
quantum/encoder.h:61:34: note: in expansion of macro ‘ARRAY_SIZE’
 #            define NUM_ENCODERS ARRAY_SIZE(((pin_t[])ENCODERS_PAD_A))
                                  ^
quantum/encoder.h:63:35: note: in expansion of macro ‘NUM_ENCODERS’
 #        define NUM_ENCODERS_LEFT NUM_ENCODERS
                                   ^
quantum/encoder.h:74:43: note: in expansion of macro ‘NUM_ENCODERS_LEFT’
 #    define NUM_ENCODERS_MAX_PER_SIDE MAX(NUM_ENCODERS_LEFT, NUM_ENCODERS_RIGHT)
                                           ^
quantum/encoder.h:77:52: note: in expansion of macro ‘NUM_ENCODERS_MAX_PER_SIDE’
 #        define MAX_QUEUED_ENCODER_EVENTS MAX(4, ((NUM_ENCODERS_MAX_PER_SIDE) + 1))
                                                    ^
quantum/encoder.h:90:27: note: in expansion of macro ‘MAX_QUEUED_ENCODER_EVENTS’
     encoder_event_t queue[MAX_QUEUED_ENCODER_EVENTS];
                           ^
 [ERRORS]
 | 
 | 
 | 
gmake: *** [builddefs/common_rules.mk:373: .build/obj_kb28_aleena/.build/obj_kb28_aleena/src/default_keyboard.o] Error 1

i don't know why it's giving errors on these and i'm not finding any support or related help on this from some simple googling. i'm trying to use most of the code i was given for this by the company but so far it's needed a lot of editing and fixing to clean up as when i tried just compiling what they gave me, it gave a ton of errors that i've already put a lot of work into solving, these are just some straggler errors that i'm stuck on stamping out.

also tagging @zhaqian12 as you are the author of this stuff, so if you can help that'd be awesome as well

Keyboard Used

doio/kb28

Link to product page (if applicable)

https://doioshop.com/products/doio-28keys-mechanical-keyboard?VariantsId=10115

Operating System

Linux Mint virginia 21.3 x86_64

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.5
Ψ QMK home: /home/aleena/github-clones/qmk_firmware
Ψ Detected Linux (Linux Mint 21.3).
Ψ Userspace enabled: False
Ψ Git branch: master
Ψ Repo version: 0.24.9
Ψ - Latest master: 2024-05-13 20:20:47 +0200 (fcbbaf4485) -- Fix for RGB color override and brightness for EC Type K (#23703)
Ψ - Latest upstream/master: 2024-08-07 16:40:31 -0400 (5acc3b2b7b) -- Add extra compatibility to Sat75 HS PCB (#24156)
Ψ - Latest upstream/develop: None
Ψ - Common ancestor with upstream/master: 2024-05-13 20:20:47 +0200 (fcbbaf4485) -- Fix for RGB color override and brightness for EC Type K (#23703)
Ψ - Common ancestor with upstream/develop: None
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 10.3.1
Ψ Found avr-gcc version 5.4.0
Ψ Found avrdude version 6.3-20171130
Ψ Found dfu-programmer version 0.6.1
Ψ Found dfu-util version 0.9
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2023-04-15 13:48:04 +0000 --  (11edb1610)
Ψ - lib/chibios-contrib: 2023-11-27 18:15:44 +0100 --  (9d7a7f90)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2023-02-12 20:19:37 +0100 --  (a3398d8)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ QMK is ready to go

Is AutoHotKey / Karabiner installed

Other keyboard-related software installed

VIA

Additional Context

here's the config.h code

/* Copyright 2021 ZhaQian
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#define MATRIX_ROWS 6
#define MATRIX_COLS 9

#define DIODE_DIRECTION COL2ROW

#define DEBOUNCE 5

#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE

#define FORCE_NKRO

/* key encoders pins*/
#define ENCODERS_PAD_A { B5, A5, A3 }
#define ENCODERS_PAD_B { B6, A6, A4 }
#define ENCODER_RESOLUTIONS \
    { 4, 4, 4 }

#define ENCODER_DEFAULT_POS 0X03

/* OLED */
#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
// #define OLED_BRIGHTNESS 5
#define OLED_TIMEOUT 10000000
#endif

#ifdef OLED_ENABLE
    /* Mapping I2C2 for OLED */
    #define I2C1_SCL_PIN B10
    #define I2C1_SDA_PIN B11
    #define I2C_DRIVER I2CD2

#endif

/* WS2812 RGB */
#ifdef RGB_MATRIX_ENABLE
#define APA102_DI_PIN A10
#define RGBLED_NUM 28
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LAYERS
#define RGBLIGHT_LAYER_BLINK
#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF

#define RGB_MATRIX_LED_COUNT (RGBLED_NUM)
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_TIMEOUT 0
#define RGB_DISABLE_AFTER_TIMEOUT 0
#define RGB_MATRIX_SLEEP false
#define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5
#define RGB_MATRIX_LED_FLUSH_LIMIT 16
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 128
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
#define RGB_MATRIX_STARTUP_HUE 0
#define RGB_MATRIX_STARTUP_SAT 255
#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_STARTUP_SPD 127
// Enable Effects
// #define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
// #define ENABLE_RGB_MATRIX_CYCLE_ALL
// #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
// #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
// #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
// #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
// #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
// #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
// #define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
// #define ENABLE_RGB_MATRIX_HUE_BREATHING
// #define ENABLE_RGB_MATRIX_HUE_PENDULUM
// #define ENABLE_RGB_MATRIX_HUE_WAVE
// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif

/* VIA */
// #ifdef VIA_ENABLE
// #define DYNAMIC_KEYMAP_LAYER_COUNT 2
// #endif

#define DYNAMIC_KEYMAP_LAYER_COUNT 6

here's info.json

{
    "keyboard_name": "KB28G",
    "manufacturer": "DOIO",
    "maintainer": "Alice",
    "usb": {
        "vid": "0xD010",
        "pid": "0x2801",
        "device_version": "0.0.1"
    },
    "bootloader": "qmk-hid",
    "layouts": {
      "LAYOUT":{
        "layout": [
            {"matrix": [5,3], "x": 0.75, "y": 0.25},
            {"matrix": [5,0], "x": 13, "y": 0.25},
            {"matrix": [4,1], "x": 13, "y": 0.25},
            {"matrix": [5,1], "x": 13, "y": 0.25},
            {"matrix": [4,7], "x": 13, "y": 0.25},
            {"matrix": [5,2], "x": 0.75, "y": 0.25},
            {"matrix": [0,8], "x": 13, "y": 0.25},
            {"matrix": [0,7], "x": 0.75, "y": 0.25},
            {"matrix": [0,0], "x": 5.5, "y": -0.75},
            {"matrix": [0,1], "x": 5.5, "y": -0.75},
            {"matrix": [0,2], "x": 5.5, "y": -0.75},
            {"matrix": [0,3], "x": 5.5, "y": -0.75},
            {"matrix": [0,4], "x": 5.5, "y": -0.75},
            {"matrix": [0,5], "x": 5.5, "y": -0.75},
            {"matrix": [0,6], "x": 5.5, "y": -0.75},
            {"matrix": [1,0], "x": 5.5, "y": -0.75},
            {"matrix": [1,1], "x": 5.5, "y": -0.75},
            {"matrix": [1,2], "x": 5.5, "y": -0.75},
            {"matrix": [1,3], "x": 5.5, "y": -0.75},
            {"matrix": [1,4], "x": 5.5, "y": -0.75},
            {"matrix": [1,5], "x": 5.5, "y": -0.75},
            {"matrix": [1,6], "x": 5.5, "y": -0.75},
            {"matrix": [2,0], "x": 5.5, "y": -0.75},
            {"matrix": [2,1], "x": 5.5, "y": -0.75},
            {"matrix": [2,2], "x": 5.5, "y": -0.75},
            {"matrix": [2,3], "x": 5.5, "y": -0.75},
            {"matrix": [2,4], "x": 5.5, "y": -0.75},
            {"matrix": [2,5], "x": 5.5, "y": -0.75},
            {"matrix": [2,6], "x": 5.5, "y": -0.75},
            {"matrix": [3,0], "x": 5.5, "y": -0.75},
            {"matrix": [3,1], "x": 5.5, "y": -0.75},
            {"matrix": [3,2], "x": 5.5, "y": -0.75},
            {"matrix": [3,3], "x": 5.5, "y": -0.75},
            {"matrix": [3,4], "x": 5.5, "y": -0.75},
            {"matrix": [3,5], "x": 5.5, "y": -0.75},
            {"matrix": [3,6], "x": 5.5, "y": -0.75},
            {"matrix": [4,8], "x": 15.75, "y": -0.75},
            {"matrix": [5,5], "x": 0.5, "y": -0.75},
            {"matrix": [4,6], "x": 0.5, "y": -0.75},
            {"matrix": [5,4], "x": 0.5, "y": -0.75},
            {"matrix": [1,8], "x": 11.5, "y": -0.75},
            {"matrix": [1,7], "x": 0.75, "y": -0.75},
            {"matrix": [4,2], "x": 3.25, "y": -7, "r": 45},
            {"matrix": [4,4], "x": 0, "y": -7},
            {"matrix": [4,3], "x": 3.5, "y": 0.25},
            {"matrix": [4,5], "x": 0, "y": 0.25},
            ]
        }
    }
}

and kb28g.h

/* Copyright 2022 ZhaQian
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "quantum.h"

#define LAYOUT( \
    K00, K01, K02, K03, K04, K05, K06, \
    K10, K11, K12, K13, K14, K15, K16, \
    K20, K21, K22, K23, K24, K25, K26, \
    K30, K31, K32, K33, K34, K35, K36, \
    K41, K42, K43, K44, K45, K46, K47, K48,  \
    K50, K51, K52, K53, K54, K55, K07, K08, K17, K18  \
) { \
    { K00,   K01,   K02,   K03,   K04,   K05,   K06,   K07,   K08 }, \
    { K10,   K11,   K12,   K13,   K14,   K15,   K16,   K17,   K18 }, \
    { K20,   K21,   K22,   K23,   K24,   K25,   K26,   KC_NO, KC_NO }, \
    { K30,   K31,   K32,   K33,   K34,   K35,   K36,   KC_NO, KC_NO }, \
    { KC_NO, K41,   K42,   K43,   K44,   K45,   K46,   K47,   K48 }, \
    { K50,   K51,   K52,   K53,   K54,   K55,   KC_NO, KC_NO, KC_NO }  \
}

as well as kb28g.c (same as keymap.c)

/* Copyright 2022 ZhaQian
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "kb28g.h"

#ifdef RGB_MATRIX_ENABLE

 led_config_t g_led_config = { {
  // Key Matrix to LED Index
  { 0,    1,   2,   3,    4,   5,    6,   NO_LED,   NO_LED},
  { 7,   8,   9,   10,  11,   12,    13,  NO_LED,   NO_LED},
  {14,   15 ,  16,   17 ,  18,   19, 20,  NO_LED,   NO_LED},
  { 21,  22,   23,  24,   25,  26,  27,   NO_LED,  NO_LED},
  { NO_LED,  NO_LED,   NO_LED,  NO_LED,   NO_LED,  NO_LED,  NO_LED,   NO_LED,  NO_LED },
  { NO_LED,  NO_LED,   NO_LED,  NO_LED,   NO_LED,  NO_LED,  NO_LED,   NO_LED,  NO_LED }
}, {
{0,0}, {37,0}, {75,0}, {112,0}, {150,0}, {187,0}, {224,0},
{0,21}, {37,21}, {75,21}, {112,21}, {150,21}, {187,21}, {224,21},
{0,43}, {37,43}, {75,43}, {112,43}, {150,43}, {187,43}, {224,43},
{0,64}, {37,64}, {75,64}, {112,64}, {150,64}, {187,64}, {224,64},
}, { 
    4,4,4,4,4,4,4,
    4,4,4,4,4,4,4,
    4,4,4,4,4,4,4,
    4,4,4,4,4,4,4
} };

void suspend_power_down_kb(void) {
  rgb_matrix_set_suspend_state(true);
}

void suspend_wakeup_init_kb(void) {
  rgb_matrix_set_suspend_state(false);
}

#endif

and my rules.mk in the root for the keyboard, and the keymap folder

# Build Options
#   comment out to disable the options.
# for doio KB28
#
BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = no
NKRO_ENABLE = yes
RGBLIGHT_ENABLE = no
AUDIO_ENABLE = no
OLED_ENABLE = yes
OLED_DRIVER = ssd1306
ENCODER_ENABLE = yes
UNICODE_ENABLE = yes
VIA_ENABLE = yes
RAW_ENABLE = yes

i'm kinda hoping this is because i've overlooked something in the documentation, and not some issue with the actual firmware itself. i feel like maybe the code i was given is incompatible or maybe this is a much larger issue. i've been at this a while, so any and all help is appreciated as i've really hit a wall here.

tzarc commented 1 month ago

Pretty sure your avr-gcc is just plain too old.

Nebula-0-System commented 1 month ago

Pretty sure your avr-gcc is just plain too old.

if i may ask, what is that? and how do i update it?

tzarc commented 1 month ago

It's the compiler that effectively converts the source code for QMK into a usable binary to flash your keyboard. Unfortunately Debian-derived Linux distro's such as the Linux Mint you're using package an ancient copy of avr-gcc.

If you've got Docker installed, it's probably simplest to use that to build as the container includes a newer version:

./util/docker_cmd.sh qmk compile -kb kb28 -km aleena
Nebula-0-System commented 1 month ago

It's the compiler that effectively converts the source code for QMK into a usable binary to flash your keyboard. Unfortunately Debian-derived Linux distro's such as the Linux Mint you're using package an ancient copy of avr-gcc.

If you've got Docker installed, it's probably simplest to use that to build as the container includes a newer version:

./util/docker_cmd.sh qmk compile -kb kb28 -km aleena

wow, had no idea it'd be something like that. i'll try it and get back to you

Nebula-0-System commented 1 month ago

new errors, so at least we're getting somewhere. it prompted me to change some values in the code, but still giving errors now that i fixed that

Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=kb28 KEYMAP=aleena KEYBOARD_FILESAFE=kb28 TARGET=kb28_aleena INTERMEDIATE_OUTPUT=.build/obj_kb28_aleena VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk"

avr-gcc (GCC) 8.3.0
Copyright (C) 2018 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.

Compiling: .build/obj_kb28_aleena/src/default_keyboard.c                                            [OK]
Compiling: quantum/keymap_introspection.c                                                          quantum/keymap_introspection.c: In function 'keymap_layer_count_raw':
quantum/keymap_introspection.c:17:49: error: 'keymaps' undeclared (first use in this function)
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:20:12: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
     return NUM_KEYMAP_LAYERS_RAW;
            ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c:17:49: note: each undeclared identifier is reported only once for each function it appears in
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:20:12: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
     return NUM_KEYMAP_LAYERS_RAW;
            ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: At top level:
quantum/keymap_introspection.c:17:49: error: 'keymaps' undeclared here (not in a function)
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                                                 ^~~~~~~
quantum/keymap_introspection.c:28:16: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
 _Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
                ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c:17:31: error: expression in static assertion is not an integer
 #define NUM_KEYMAP_LAYERS_RAW ((uint8_t)(sizeof(keymaps) / ((MATRIX_ROWS) * (MATRIX_COLS) * sizeof(uint16_t))))
                               ^
quantum/keymap_introspection.c:28:16: note: in expansion of macro 'NUM_KEYMAP_LAYERS_RAW'
 _Static_assert(NUM_KEYMAP_LAYERS_RAW <= MAX_LAYER, "Number of keymap layers exceeds maximum set by DYNAMIC_KEYMAP_LAYER_COUNT");
                ^~~~~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: In function 'keymap_layer_count_raw':
quantum/keymap_introspection.c:21:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
 [ERRORS]
 | 
 | 
 | 
gmake: *** [builddefs/common_rules.mk:373: .build/obj_kb28_aleena/quantum/keymap_introspection.o] Error 1

again, it's more core stuff to the repo, so i feel i shouldn't need to change it. any other ideas? if not i'll just fix it myself and put in a PR when this is all said and done

lesshonor commented 1 month ago

If your keyboards/doio/kb28/keymaps/default/keymap.c is identical to keymaps/doio/kb28/kb28g.c, you effectively don't have a keymap (which is required).

Examining other keyboards in the repository along with the documentation will provide helpful information about the structure of this file.

If I've misread or misunderstood, perhaps make is not rebuilding all the files it needs to; running qmk clean will help there.

Nebula-0-System commented 1 month ago

If your keyboards/doio/kb28/keymaps/default/keymap.c is identical to keymaps/doio/kb28/kb28g.c, you effectively don't have a keymap (which is required).

Examining other keyboards in the repository along with the documentation will provide helpful information about the structure of this file.

wow, i did not read that well enough, thought that was the default keymap, not that it was just for the LEDs. i also just realized the error specifically states "keymaps undeclared"

i'll fix that now and let you know.

Nebula-0-System commented 1 month ago

ok got very far, all the way to flashing in fact (after removing #include "kb28g.h" in the keymap.c), but at the last line i got

sh: 1: hid_bootloader_cli: not found
gmake: *** [platforms/avr/flash.mk:173: flash] Error 127

which i checked, and it requires you to specify the microcontroller, which i did, and it still didn't work.

that said there was a previous issue i thought i solved where it wouldn't let me compile the right bootloader for the chip, so i just chose qmk-hid as it seemed like the generic option and it stopped giving me "invalid bootloader specified". maybe that was a mistake and i didn't actually solve the issue? i don't think so as it did seem to work afterwards.

lesshonor commented 1 month ago

so i just chose qmk-hid as it seemed like the generic option

There is no generic option for bootloaders; these are hardware-specific.

It would be a good idea to upload the original code as-provided to a public repository, since it is unknown what you've changed or what microcontroller the PCB uses. Given the original error message you mention of an invalid bootloader, seeking assistance with the conversion in the QMK Discord is also recommended.

It doesn't sound like the bootloader situation is simple/standard, and getting this wrong has the potential to "brick" the PCB. (You would need to acquire a hardware programmer to reprogram the bootloader using specific pins if that happens.)

Nebula-0-System commented 1 month ago

so i just chose qmk-hid as it seemed like the generic option

There is no generic option for bootloaders; these are hardware-specific.

It would be a good idea to upload the original code as-provided to a public repository, since it is unknown what you've changed or what microcontroller the PCB uses. Given the original error message you mention of an invalid bootloader, seeking assistance with the conversion in the QMK Discord is also recommended.

It doesn't sound like the bootloader situation is simple/standard, and getting this wrong has the potential to "brick" the PCB. (You would need to acquire a hardware programmer to reprogram the bootloader using specific pins if that happens.)

alright, thank you. i'll move there and close this then as clearly it's not a bug or whatever, but has to do with the KB code. thanks for the help in getting me closer