Commit Graph

79 Commits

Author SHA1 Message Date
lalalademaxiya1
77d9352237 Merge qmk develop into playground 2022-10-19 15:06:51 +08: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
lalalademaxiya1
15105613f9 Merge qmk develop branch into playground 2022-09-27 10:59:03 +08: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
lalalademaxiya1
0eb4a0347f Merge branch 'develop' into playground 2022-09-20 14:17:05 +08: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
lalalademaxiya1
b2f6c42b7a Merge branch 'develop' into playground 2022-09-15 11:50:50 +08: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
lalalademaxiya1
a7ecd8e1f9 Merge 2022-08-25 17:22:40 +08:00
Nick Brassel
1eac095c0c
Use the correct bootloader definition. (#18102) 2022-08-19 05:20:44 +01:00
xiaonvziduoqing
8c674af028 Merge branch 'develop' into playground 2022-08-16 13:57:25 +08:00
Joel Challis
463fb72d29
Partially revert some WB32 specific changes (#18038) 2022-08-14 20:48:44 +01:00
lalalademaxiya1
62d14ad731 Update ckled2001.c 2022-08-14 16:26:17 +08: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
Joy Lee
19ce1418ba
Added implementation of WB32 MCU wear_leveling_efl. (#17579) 2022-08-13 02:14:33 +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
lalalademaxiya1
820642264c Update quantum/via.c 2022-07-30 15:12:04 +08: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
lalalademaxiya1
7afdf42dd0 Update common_features.mk 2022-07-14 12:25:00 +08:00
lalalademaxiya1
efcd6e0f37 Update wear_leveling_efl.c 2022-07-14 12:22:26 +08: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
lalalademaxiya1
d1ce8f74a8 Merge 2022-07-11 23:33:15 +08: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
lalalademaxiya1
b066af9656 Add eeprom_stm32_l4.h 2022-07-07 14:44:00 +08:00
lalalademaxiya1
26af2efb5d Merge branch 'playground' of https://github.com/lalalademaxiya1/qmk_firmware into playground 2022-07-07 14:08:57 +08:00
lalalademaxiya1
765c219388 Update q1 for keychron 2022-07-07 12:33:22 +08:00
Nick Brassel
29a2bac469
Fixup SPI. (#17534) 2022-07-05 22:41:35 +02:00
Nick Brassel
5846b40f74
RP2040 emulated EEPROM. (#17519) 2022-07-02 15:18:50 +10: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
lalalademaxiya1
eb3e14c61b Updare platforms/chibios 2022-06-30 11:39:38 +08:00
lalalademaxiya1
9ab79d6418 Merge branch 'playground_new' into playground
Update playground with the latest features from branch develop in qmk
2022-06-30 10:09:59 +08:00
lalalademaxiya1
59d0c00ecb Merge remote-tracking branch 'upstream/develop' into playground_new
Add new features
2022-06-30 09:55:17 +08:00
Nick Brassel
34e244cecf
Wear-leveling EEPROM drivers: embedded_flash, spi_flash, legacy (#17376) 2022-06-30 07:42:23 +10:00
lalalademaxiya1
aae4f196d4 Resolve conflicting files 2022-06-28 23:51:51 +08:00
lalalademaxiya1
58aba271f3 Update eeprom_stm32_l4.c 2022-06-27 11:11:10 +08:00
lalalademaxiya1
08095b3f3d Resolve conflicts for merge playground_new into playground 2022-06-27 10:33:05 +08:00
Stefan Kerkmann
2703ecc9e9
[BUG] Fix deadlocks on disconnected secondary half (#17423) 2022-06-21 08:24:53 +10:00
Stefan Kerkmann
fe680a8568
[Core] Split ChibiOS usart split driver in protocol and hardware driver part (#16669) 2022-06-18 08:04:17 +10:00
Stefan Kerkmann
6d67e9df4b
[Core] Allow usage of ChibiOS's SIO driver for split keyboards (#15907) 2022-06-17 22:06:44 +02:00
lalalademaxiya1
80fc251925 Add keychron keyboards. 2022-06-15 19:47:31 +08:00
lalalademaxiya1
f80692c140 Add new features for keychron keyboards. 2022-06-15 13:33:14 +08:00
Nick Brassel
1085500e89
Rework paths for eeprom locations. (#17326)
* Rework paths for eeprom locations.

* File relocation.

* Wrong file move.

* Fixup test paths.
2022-06-08 09:42:35 +10:00