Commit Graph

287 Commits (dd94877ec6d2ee5c4cdb0e71287abd76585b0268)

Author SHA1 Message Date
Sergey Vlasov 584b7cf801
Fix build failures with `OPT = 0` due to inline functions (#19767)
Co-authored-by: Joel Challis <git@zvecr.com>
2023-02-12 17:14:34 +11:00
miguelelinventor e24f9b2c0a
Add Michi MCU Converter support (#19163) 2023-02-09 11:27:37 -08:00
Nick Brassel f6dd8dea2e
Remove usages of config_common.h from config.h files. (#19714) 2023-01-31 06:03:30 +11:00
Joel Challis 8cc2e0e906
Fix quantum ring_buffer for ChibiOS (#19683) 2023-01-28 21:07:51 +00:00
Joel Challis 832479c7fb
Split out mcu_selection to platform (#19701) 2023-01-29 07:40:47 +11:00
Sergey Vlasov 81ca83296f
analog.c: Fix `pinToMux()` for STM32F0xx (#19658)
The `adc_read()` code for STM32F0xx expects to get the 0-based channel
number in `mux.input`, but the `pinToMux()` code for STM32F0xx was
attempting to pass the CHSELR bit mask in that field, which resulted in
selecting a wrong channel, therefore `analogReadPin()` did not work
properly for the STM32F0xx chips.  Fix `pinToMux()` to put the channel
number in that field (this matches the behavior for other supported
chips and also allows selection of channels 16...18, which can be used
to access the builtin temperature, reference voltage and VBAT sensors).
2023-01-25 01:47:55 +00:00
Stefan Kerkmann 8ca3f0fb7c
[Bug] rp2040: fix timer wrap deadlock in ws2812 vendor driver (#19652)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
2023-01-23 22:24:21 +01:00
David Hoelscher aea1194ea3
Corrections to uart driver for Chibios platform (#19075) 2023-01-24 07:05:47 +11:00
Ryan cf935d97ae
Fix functions with empty params (#19647)
* Fix functions with empty params

* Found a bunch more
2023-01-20 16:21:17 +00:00
QMK Bot 3723c0e3d5 Merge remote-tracking branch 'origin/master' into develop 2023-01-19 01:06:08 +00:00
Nick Brassel 327f7ee9a7
Fixup ChibiOS header inclusion search ordering. (#19623)
* Add STM32F446-Nucleo onekey. 

* Fixup onekey build for F446, all keymaps.

* Fixup board inclusion search ordering.
2023-01-19 01:05:29 +00:00
Joel Challis 0ce3f6bcfe
De-duplicate platform detection (#19603) 2023-01-19 00:27:00 +00:00
Sergey Vlasov 272281f1a0
Add analog support for RP2040 (#19453)
Co-authored-by: Ryan <fauxpark@gmail.com>
2023-01-19 10:30:58 +11:00
Joel Challis 12f1a30d16
Add alias support for converters (#19563) 2023-01-18 23:16:33 +00:00
Joel Challis 82a94ea1bd
Add f303 to tinyuf2 bootloader support (#19620) 2023-01-18 22:36:58 +00:00
Joel Challis 0730740add
Add mmoskal/uf2-stm32f103 bootloader support (#19594) 2023-01-15 15:04:32 +00:00
Stefan Kerkmann ec09087543
Update ChibiOS[-Contrib], SIO driver, configs (#17915)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2023-01-12 21:47:36 +11:00
Joel Challis 46c85c93f0
Revert "De-duplicate platform detection (#19545)" (#19564)
This reverts commit e11235ee14.
2023-01-11 19:58:27 +00:00
Joel Challis e11235ee14
De-duplicate platform detection (#19545) 2023-01-11 02:13:32 +00:00
Stefan Kerkmann 962e4c0e18
[Test] Reset timer for every unit test and provide timestamps for log messages (#17028) 2022-12-15 02:31:08 +11:00
jpe230 102f22f7e9
[Core] Quantum Painter - LVGL Integration (#18499)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-12-13 07:51:14 +11:00
Stefan Kerkmann 9dc3f79196
[RP2040] update i2c drivers to reflect peripheral number (#19277) 2022-12-11 14:04:29 +01:00
Ryan 701747ad4f
Teensy 3.5: do not restart USB stack after wakeup (#19269) 2022-12-09 01:41:22 +00:00
Michael Stapelberg 9e103a2c58
kint36: do not restart USB stack after wakeup (#19077) 2022-12-09 03:49:58 +11:00
Nick Brassel cf3c26533c
Fixup EFL and F4's sector selection. (#19221) 2022-12-02 21:55:28 +11:00
Nick Brassel bebfdad795
NVRAM refactor, phase 1. (#18969)
* Rename `eeprom_stm32` to `eeprom_legacy_emulated_flash`.

* Rename `flash_stm32` to `legacy_flash_ops`.

* Rename `eeprom_teensy` to `eeprom_kinetis_flexram`.
2022-11-23 08:50:19 +00:00
David Hoelscher a42ab90220
Add Bonsai C4 as a platform board file (#18901)
* Set up Bonsai C4 as a platform board file

* corrections and improvements based on testing and feedback

* Added VBUS sensing as default capability for improved split support using Bonsai C4

* Update clock divisor for SPI flash

Co-authored-by: Nick Brassel <nick@tzarc.org>

Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-11-13 23:59:01 +00:00
Nick Brassel 092228571c
Move EFL wear-leveling driver to be default for F1, F3, F4, L4, G4, WB32, GD32V. (#19020) 2022-11-11 23:57:44 +00:00
jack dad5262425
Fixup WS2812 vendor driver (#19028) 2022-11-11 09:38:13 +11:00
Stefan Kerkmann 27dec8d16d
[Core] Allow custom timings for WS2812 PIO driver (#18006) 2022-11-10 07:58:15 +11:00
Drashna Jael're d9e559a78e
Merge remote-tracking branch 'origin/master' into develop 2022-11-06 09:05:52 -08:00
Joy Lee 9435ad19ee
Added analog support for WB32 MCU. (#18289)
Co-authored-by: Joy <chang.li@westberrytech.com>
2022-11-01 15:04:15 +11:00
Joel Challis 96c48a5f4a
Refactor to avoid deprecated wmic execution (#18122)
* wmic deprecated?

* Update platforms/avr/flash.mk

* Update platforms/avr/flash.mk
2022-10-31 20:16:43 +00:00
Stefan Kerkmann 19145704e4
[Core] Adjust PWM hardware audio driver for RP2040 (#17723) 2022-10-27 19:26:16 +02:00
Joel Challis 575db6949a
Generalise CTPC logic from common_features (#18803) 2022-10-22 12:39:39 -07:00
Thomas Kriechbaumer c4f99f06ab
ws2812: replace RGBLED_NUM with driver-owned constant to decouple driver from RGBLEDs/RGBMATRIX defines (#18036) 2022-10-21 08:17:51 +11:00
QMK Bot c57330d340 Merge remote-tracking branch 'origin/master' into develop 2022-10-16 20:31:26 +00:00
Nick Brassel f731e2789f
Allow Fedora to update ChibiOS configs. (#18698) 2022-10-17 07:30:49 +11:00
Joel Challis c59df9a54c
Fix some rp2040 hardware ID errors (#18617) 2022-10-06 00:36:48 +01:00
Joel Challis f120b39fb0
Update ChibiOS hardware ID (#18613) 2022-10-05 21:20:09 +01:00
Ryan 4d6fab1cfa
onekey: Enable ADC for STM32F072 Discovery (#18592) 2022-10-05 11:36:20 +11:00
Stefan Kerkmann 7e844a4d55
[Core] RP2040: use built-in integer hardware divider and optimized i64 multiplication (#18464) 2022-10-04 23:43:38 +02:00
Stefan Kerkmann 996a9006d3
[Core] PWM Backlight for RP2040 (#17706) 2022-10-04 23:10:24 +02:00
Stefan Kerkmann b6ea8837e4
[Bug] RP2040: only clear RX FIFO for serial pio driver clear (#18581) 2022-10-04 19:56:40 +01:00
Stefan Kerkmann 6bbcabe0cc
[Core] Serial-protocol: always clear receive queue on main half of split keyboard (#18419) 2022-10-03 18:23:45 +02:00
QMK Bot f5df1b155a Merge remote-tracking branch 'origin/master' into develop 2022-10-03 01:26:40 +00:00
Ryan cc1565f2a3
`:flash`: print bootloader (#18569) 2022-10-03 12:26:04 +11:00
Stefan Kerkmann b8ffaa6331
Copy RP2040 vector table to RAM on startup (#18424)
...this reduces possible latency when invoking interrupt handlers by
mitigating XIP cache misses which are not existent when running code from
RAM.
2022-09-22 22:48:20 +01:00
Stefan Kerkmann 881aab9e76
Stabilize Half-duplex PIO split comms take 2 (#18421)
...by moving the actually timing critical `enter_rx_state()` and
`leave_rx_state()` functions to RAM in order to not be affected by XIP
cache spikes. This commit also reverts the hacky USB interrupt disabling
that was done in 293c53d774
2022-09-20 08:54:43 +02:00
Joel Challis 1155140631
Add Elite-C to converters (#18309) 2022-09-18 20:30:27 +01:00
Ryan 33c47fe010
Add UART support for Kinetis boards (#18370)
* Add UART support for Kinetis boards

* Default PAL mode for GPIOV1
2022-09-17 02:24:03 +01:00
Joel Challis 4087251da6
Reboot wb32 devices after flashing (#18323) 2022-09-10 01:14:12 +01:00
Danny fb6e821541
Add Elite-Pi converter (#18236)
Co-authored-by: Joel Challis <git@zvecr.com>
2022-09-08 14:59:27 -04:00
Joy Lee b5a52b4cff
Prevent USB peripheral fault when restarting USB on WB32 MCUs (#18058)
Co-authored-by: Joy <chang.li@westberrytech.com>
2022-09-01 20:48:02 -07:00
QMK Bot bc4ab8a433 Merge remote-tracking branch 'origin/master' into develop 2022-09-01 22:39:30 +00:00
Joel Challis 7adef85fa4
Remove non promicro pins from converters (#18239) 2022-09-01 15:38:52 -07:00
Ryan bb6f028833
Move bootloader.mk to platforms (#18228) 2022-08-31 07:17:24 -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
Ryan d18698a8e8
Remove deprecated USBasp and bootloadHID bootloader types (#18195) 2022-08-28 21:20:43 +01:00
Joel Challis 43fd647130
Add eeprom defaults for tinyuf2 bootloader (#18042) 2022-08-25 21:17:41 +10:00
Nick Brassel 1eac095c0c
Use the correct bootloader definition. (#18102) 2022-08-19 05:20:44 +01:00
David Hoelscher a645301c82
Add Bonsai C4 converter (#17711) 2022-08-18 01:01:54 +01:00
Stefan Kerkmann f74ed5fc53
Fix GD32VF103 WS2812 PWM driver (#18067)
...by adding the missing STM32 DMA defines.
2022-08-15 18:00:22 +01:00
Joel Challis 463fb72d29
Partially revert some WB32 specific changes (#18038) 2022-08-14 20:48:44 +01:00
Mega Mind fce99f3875
[Controller] Added board config for custom controller STeMCell (#16287)
Co-authored-by: Mariappan Ramasamy <947300+Mariappan@users.noreply.github.com>
Co-authored-by: Mariappan Ramasamy <maari@basis-ai.com>
Co-authored-by: Sadek Baroudi <sadekbaroudi@gmail.com>
2022-08-14 21:27:26 +10:00
yiancar dfc92d8f7b
Fix buffer size for WS2812 PWM driver (#17046)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: yiancar <yiancar@gmail.com>
2022-08-13 18:36:34 -07:00
Joy Lee c02d7ae86f
Added ws2812_pwm support for WB32 MCU. (#17142)
Co-authored-by: Joy <chang.li@westberrytech.com>
2022-08-13 18:21:46 -07:00
Joy Lee 6b1c7d20aa
Added ws2812_spi support for WB32 MCU (#17143)
Co-authored-by: Joy <chang.li@westberrytech.com>
2022-08-13 18:09:57 -07:00
Takeshi ISHII a83afb3fcd
Improve avr wait_us() (#16879) 2022-08-14 00:04:03 +01:00
Jay Greco 4eeafbebab
Add Bit-C PRO converter (#17827) 2022-08-13 14:48:30 +01:00
Joy Lee 19ce1418ba
Added implementation of WB32 MCU wear_leveling_efl. (#17579) 2022-08-13 02:14:33 +01:00
Sergey Vlasov 9e44362179
Add minimal STM32F103C6 support (#17853)
Unfortunately, the crippled versions of “Bluepill” boards with
STM32F103C6xx chips instead of STM32F103C8xx are now sold all over the
place, sometimes advertised in a confusing way to make the difference
not noticeable until too late.  Add minimal support for these MCUs in
the common “Bluepill with stm32duino” configuration, so that it could be
possible to make something useful from those boards (although fitting
QMK into the available 24 KiB of flash may be rather hard).

(In fact, I'm not sure whether the “STM32” part of the chip name is
actually correct for those boards of uncertain origin, so the onekey
board name is `bluepill_f103c6`; another reason for that name is to
match the existing `blackpill_f401` and `blackpill_f411`.)

The EEPROM emulation support is not included on purpose, because
enabling it without having a working firmware size check would be
irresponsible with such flash size (the chance that someone would build
a firmware where the EEPROM backing store ends up overlapping some
firmware code is really high).  Other than that, enabling the EEPROM
emulation code is mostly trivial (the `wear_leveling` driver with the
`embedded_flash` backing store even works without any custom
configuration, although its code is significantly larger than the
`vendor` driver, which may also be important for such flash size).
2022-08-11 22:37:41 +01:00
Nick Brassel d9eb152a90
Fix issue with #17904. (#17905) 2022-08-04 22:15:42 +10:00
Nick Brassel 94e8701b3e
Fixup compilation of printf-like functions with uint32_t args. (#17904) 2022-08-04 21:44:56 +10:00
Nick Brassel 543f54a483
[Core] `STM32_USB_USE_OTG1` => `USB_ENDPOINTS_ARE_REORDERABLE` (#17647) 2022-08-04 21:05:16 +10:00
Joel Challis 98d5c77521
Remove legacy AVR ssd1306 driver (#17864) 2022-07-31 22:15:01 +01:00
Stefan Kerkmann a204523bbb
[Core] RP2040 disable PIO IRQs on serial timeout (#17839) 2022-07-29 20:13:16 +02:00
Stefan Kerkmann 157ea96411
ChibiOS: use correct status codes in i2c_master.c (#17808)
msg_t is MSG_OK in the success case and either MSG_RESET or MSG_TIMEOUT
in case of errors. So actually use them in the comparison.
2022-07-28 02:02:10 +01:00
Stefan Kerkmann 083b42068a
Chibios: Stop I2C peripheral on transaction error (#17798)
From the ChibiOS HAL I2C driver pages:

After a timeout the driver must be stopped and restarted because the bus is in
an uncertain state.

This commit does that stopping explicitly on any error that occurred, not only
timeouts. As all the i2c functions restart the peripheral if necessary it is
safe to do so.

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
2022-07-26 21:40:14 +02:00
Albert Y d510e80b89
Add Blok 2040 conversion (#17603) 2022-07-21 00:54:05 +01:00
Albert Y 05f30f0787
Use Pro Micro pinout for SDA/SCL (#17595) 2022-07-20 18:24:34 +01:00
Nick Brassel dc70ba612a
Post-bootloader EFL/SPI fixes. (#17661)
* Fixup read address for EFL driver.

* Fixup sequencing of SPI.

* Lock during init of EFL backing store.
2022-07-14 00:41:08 +10:00
Nick Brassel dfff040433
Allow MCU-specific overrides for SPI flags. (#17650) 2022-07-13 14:42:24 +10:00
jack ffb34fc082
Include stdint.h in avr/i2c_master.h (#17639) 2022-07-12 21:55:19 +02:00
Stefan Kerkmann 45ffe42f1a
[Fix] Make ChibiOS `_wait.h` independent of `quantum.h` (#17645) 2022-07-12 21:54:33 +02:00
Stefan Kerkmann 3f5dc47296
[Core] Use polled waiting on ChibiOS platforms that support it (#17607)
* Use polled waiting on platforms that support it

Due to context switching overhead waiting a very short amount of time on
a sleeping thread is often not accurate and in fact not usable for timing
critical usage i.e. in a driver. Thus we use polled waiting for ranges
in the us range on platforms that support it instead. The fallback is
the thread sleeping mechanism.

This includes:

* ARM platforms with CYCCNT register (ARMv7, ARMv8) this is
  incremented at CPU clock frequency
* GD32VF103 RISC-V port with CSR_MCYCLE register this is incremented at
  CPU clock frequency
* RP2040 ARMv6 port which uses the integrated timer peripheral which is
  incremented with a fixed 1MHz frequency

* Use wait_us() instead of chSysPolledDelayX

...as it is powered by busy waiting now.

* Add chibios waiting methods test bench
2022-07-11 15:17:05 +02:00
Stefan Kerkmann 0348071810
Stabilize Half-duplex PIO split comms (#17612) 2022-07-11 04:05:04 -07:00
Albert Y cca5d35321
Update PM2040 I2C pins (#17578) 2022-07-07 09:33:11 +02:00
Stefan Kerkmann d9bb189e25
[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
2022-07-07 09:27:50 +02:00
Joel Challis 744af003be
Add kb2040 and sparkfun rp2040 converters (#17514) 2022-07-06 19:27:15 +01:00
Nick Brassel 29a2bac469
Fixup SPI. (#17534) 2022-07-05 22:41:35 +02:00
Ryan ac5e6b6a3b
Tentative Teensy 3.5 support (#14420)
* Tentative Teensy 3.5 support

* Set firmware format to .hex for ARM Teensys

* Got to "device descriptor failed" by comparing with Teensy 3.6 code

* Drop down to 96MHz...

* Bump back up to 120MHz
2022-07-03 00:12:45 +10:00
Nick Brassel 5846b40f74
RP2040 emulated EEPROM. (#17519) 2022-07-02 15:18:50 +10:00
Stefan Kerkmann 77d960cce3
Disable clang-format for stage2_bootloaders (#17516) 2022-06-30 20:07:54 +01:00
Stefan Kerkmann d717396708
[Core] Add Raspberry Pi RP2040 support (#14877)
* Disable RESET keycode because of naming conflicts

* Add Pico SDK as submodule

* Add RP2040 build support to QMK

* Adjust USB endpoint structs for RP2040

* Add RP2040 bootloader and double-tap reset routine

* Add generic and pro micro RP2040 boards

* Add RP2040 onekey keyboard

* Add WS2812 PIO DMA enabled driver and documentation

Supports regular and open-drain output configuration. RP2040 GPIOs are
sadly not 5V tolerant, so this is a bit use-less or needs extra hardware
or you take the risk to fry your hardware.

* Adjust SIO Driver for RP2040

* Adjust I2C Driver for RP2040

* Adjust SPI Driver for RP2040

* Add PIO serial driver and documentation

* Add general RP2040 documentation

* Apply suggestions from code review

Co-authored-by: Nick Brassel <nick@tzarc.org>

Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-06-30 13:19:27 +02:00
Nick Brassel 34e244cecf
Wear-leveling EEPROM drivers: `embedded_flash`, `spi_flash`, `legacy` (#17376) 2022-06-30 07:42:23 +10:00
QMK Bot e30cd0fa16 Merge remote-tracking branch 'origin/master' into develop 2022-06-25 19:35:17 +00:00
Drashna Jaelre 7fd3d76faa
[Split] Ensure SOFT_SERIAL_PIN is defined if USE_I2C isn't defined (#17466) 2022-06-25 12:34:40 -07:00
Stefan Kerkmann 9aa9155e88
[Core] Mark GD32VF103 as ChibiOS-Contrib (#17444) 2022-06-23 08:37:40 +10:00
Daniel Kao 608404f874
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()
2022-06-22 00:00:04 +02:00