Commit Graph

10 Commits (e64ec530cd966c15653eb786da2afcd20eee2f30)

Author SHA1 Message Date
Joshua Diamond e4bf832368
Add unicode mode change callbacks (#18235) 2022-08-31 16:39:16 -07:00
Jeff Epler 9632360caa
Use a macro to compute the size of arrays at compile time (#18044)
* Add ARRAY_SIZE and CEILING utility macros

* Apply a coccinelle patch to use ARRAY_SIZE

* fix up some straggling items

* Fix 'make test:secure'

* Enhance ARRAY_SIZE macro to reject acting on pointers

The previous definition would not produce a diagnostic for
```
int *p;
size_t num_elem = ARRAY_SIZE(p)
```
but the new one will.

* explicitly get definition of ARRAY_SIZE

* Convert to ARRAY_SIZE when const is involved

The following spatch finds additional instances where the array is
const and the division is by the size of the type, not the size of
the first element:
```
@ rule5a using "empty.iso" @
type T;
const T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)

@ rule6a using "empty.iso" @
type T;
const T[] E;
@@

- sizeof(E)/sizeof(T)
+ ARRAY_SIZE(E)
```

* New instances of ARRAY_SIZE added since initial spatch run

* Use `ARRAY_SIZE` in docs (found by grep)

* Manually use ARRAY_SIZE

hs_set is expected to be the same size as uint16_t, though it's made
of two 8-bit integers

* Just like char, sizeof(uint8_t) is guaranteed to be 1

This is at least true on any plausible system where qmk is actually used.

Per my understanding it's universally true, assuming that uint8_t exists:
https://stackoverflow.com/questions/48655310/can-i-assume-that-sizeofuint8-t-1

* Run qmk-format on core C files touched in this branch

Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
2022-08-30 10:20:04 +02:00
Joshua Diamond 37a85e1f9b
More spidey3 userspace cleanup (#18049) 2022-08-28 10:10:28 -07:00
Joshua Diamond 5408334083
Update ginkgo65hot to allow use of community layouts (#17911) 2022-08-06 13:29:06 -07:00
Joshua Diamond baf34989f1
Default rgblight (#17855)
* better rgb bindings; improve default

* trim firmware size
2022-07-30 18:31:31 -04:00
Joshua Diamond f02e355380
More glyph transformations for spidey3 userspace (#17854)
* add bold and blackboard bold glyph transformations

* trim firmware size; cformat

* fix typo in macro

* trim firmware size a bit more
2022-07-30 18:21:54 -04:00
Joshua Diamond 07a1574732
[Keymap] Revamp spidey3 userspace and keymaps (#11768)
* Don't block keys during startup animation

* More refinements related to startup and debug state

* restore key logging

* some cleanup on scan rate reporting

* trim some fat

* better lighting to indicate jumped to bootloader

* use eeprom for state restoration

* a little reorganization

* report version immediately when turn on debug

* hold-to-adjust for hue, sat, val

* cformat

* reorg rules.mk settings, fix compile with CONSOLE_ENABLE=no

* simplify spidey3 userspace

* NULL in layer list caused buggy behavior

* more bugfix

* update numpad layout to match matt30 MT3 /dev/tty keycaps

* swap emdash and endash

* map shift+backspace to delete

* removing NO_ACTION_ONSHOT makes the firmware SMALLER ?!

* cformat

* improve spi_glow

* disable shift-backspace = delete by default
2021-02-06 13:04:25 -08:00
Joshua Diamond d03bc3a9c1
Major enhancements to spidey3 keymaps and userspace (#9261)
* Add Chrome OS specific keys to 75_ansi/spidey3

* Clean up duplicative settings in rules.mk

* Refactor spidey3 userspace to use rgb layer blink

* Blink green on wakeup

* Improve _FN layer indicator

* Glyph transformation modes: wide, script, fraktur, and enclosed characters

* Add spider unicode glyph

* Fix compile error when NO_ACTION_ONESHOT

* Add a few more emoji

* Further refinement of lighting layer usage

* Fix reversed yes/no ack

* Lighting layers override RGB off

* Fix missing wide and incorrect script numbers

* Add LOL and surprise emoji

* Add missing break in switch statement

* Trim firmware size

* Use usage ID definitions in report.h

* Some minor whitespace cleanup

* Disable some unused features to reduce firmware size

* Print version on startup

* Seed rand() on first keystroke

* Add a key to immediately sleep CrOS

* Switch to Bootmagic Lite

* Trim down firmware size a little bit more

* Make RGBLIGHT_MODE_TWINKLE+4 my default

* Scan rate debug / fix version printing

Delay printing version on startup (console may not be ready)
Better scan rate reporting

* Disable locking caps, etc. to save more space

* Enable LTO

* Better seed for rand()

* Set MAX_LAYER for some performance improvement

* Another scan rate improvement

* Set manufacturer

* New startup animation

* Add GUI lock for F-keys (for CrOS)

* Add visual indication for glyph replacement and F-keys GUI lock

* Some cleanup; run cformat on spidey3 userspace

* Cycle between debug verbosity options

* Fix disable RGB Lighting after wakeup on Mac
2020-06-05 02:01:47 -07:00
Joshua Moses Diamond e4cc642a79
Some refinements of 75_ansi/spidey3 layout (#8581)
* First cut at Josh Diamond's KBD75 customizations.
Includes:
* My unique keymap with ChromeOS specific keys
* Use RGB underglow to indicate Caps Lock
* Some unicode bindings
* Some changes to make debugging easier

* Updated spidey3 to be applicable to all 75_ansi boards

* Sadly, ChromeOS doesn't pay attention to most consumer codes

* Add mac layer; fix flakeyness in CAPS_LOCK underglow.

* Make layers.json match the keymap (to the extent possible)

* Major cleanup; fix broken debug persistence

* Cleanup some whitespace issues

* Fix incorrect log message.

* Rework layer indication to user RGBLIGHT_LAYERS

* Update layouts/community/75_ansi/spidey3/keymap.c

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Rename users/spidey3/rgblight.c to layer_rgb.c per suggestion

* Refactor to use set_single_persistant_default_layer().

* Use dprint/f to make logging more elegant.

* Update users/spidey3/config.h

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Update users/spidey3/config.h

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Update layouts/community/75_ansi/spidey3/rules.mk

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/spidey3.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/layer_rgb.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/init.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Changes from code review

* Numpad layer, various keys for 75_ansi/spidey3

* Add Fn-B to toggle NKRO

* Blink rgb to acknowledge some setting changes

* Updated media control & reset key location

* Minor cleanup

Co-authored-by: Joshua Diamond <jdiamond@Deep-Thought.local>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
2020-04-11 10:10:37 +10:00
spidey3 7e0dc5376f
[Keymap] Add spidey3 keymap for 75_ansi, and a spidey3 userspace (#8470)
* First cut at Josh Diamond's KBD75 customizations.
Includes:
* My unique keymap with ChromeOS specific keys
* Use RGB underglow to indicate Caps Lock
* Some unicode bindings
* Some changes to make debugging easier

* Updated spidey3 to be applicable to all 75_ansi boards

* Sadly, ChromeOS doesn't pay attention to most consumer codes

* Add mac layer; fix flakeyness in CAPS_LOCK underglow.

* Make layers.json match the keymap (to the extent possible)

* Major cleanup; fix broken debug persistence

* Cleanup some whitespace issues

* Fix incorrect log message.

* Rework layer indication to user RGBLIGHT_LAYERS

* Update layouts/community/75_ansi/spidey3/keymap.c

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Rename users/spidey3/rgblight.c to layer_rgb.c per suggestion

* Refactor to use set_single_persistant_default_layer().

* Use dprint/f to make logging more elegant.

* Update users/spidey3/config.h

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Update users/spidey3/config.h

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Update layouts/community/75_ansi/spidey3/rules.mk

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/spidey3.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/layer_rgb.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update users/spidey3/init.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Changes from code review

Co-authored-by: Joshua Diamond <jdiamond@Deep-Thought.local>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
2020-03-22 21:11:41 -07:00