[atreus] Atreus Firmware + Ragel logic

  • From: fer febles <ferfebles@xxxxxxxxx>
  • To: atreus@xxxxxxxxxxxxx
  • Date: Sat, 27 Jan 2018 09:33:56 +0000

I've been playing with the Atreus firmware trying to change layers by hold,
click or double-click the 'fn' key.

Implementing the logic by hand with 'ifs', 'elses' and state variables was
prone to errors and strange behaviours.

Then I tried with Ragel, a state machine compiler. And It worked!

I've been able to expand the previous logic, like going to 'Hold' layer
from any previous state, without any problem.

The firmware has several customizations, it came from a fork with logic to
use LEDs as layer indicators. All the Ragel logic is in the
'layout_common.rl' file.

You can see the code in
https://github.com/ferfebles/atreus-2leds1speaker-ragel

Other related posts: