New “Testing” branch of the firmware!

Something cool has happened this weekend!

While updating the AB412 head code to work with XTrident 412 in Xplane I decided to rewrite it in a better way, and then inspiration kicked in and I have made a few important changes in the firmware structure =)

Up to this point, simchair firmware was basically a collection of loosely connected independent files with nothing but a few global variables in common. That means every file was different, to create a new device we had to copy a file powering a similar one and edit it. Usually, that file ended up containing functions, very similar to ones in the other files. That was beginning to look like a mess, so I decided to improve it by making the firmware look more like a library.

So far, I have rewritten 412 head and MKIII single collective files, here are the most notable changes:

  • The 412 head now has two “middle” positions for starter and idle rel switches, Xtrident AB412 should work fine with the Lua script from extras dir of the repo
  • collective heads now have unified functions to create an array of buttons from bytes and parse it. Those functions should be usable for any other head we will have! The first head I have updated is the 412 one.
  • virtual buttons can be added to any collective head in a simple way. So far “middle” buttons of switches are supported, just tell the function where you want them to be =)
  • collective levers now have a universal set of functions as well. The amount of code needed to run the lever has notably decreased, it became much more readable! Below you can see the whole single collective MKIII code:
Single collective MKIII master code

All other levers will be using those functions in a while, and that will help us to eliminate a lot of bugs- instead of having to trace individual bugs for each device and copy the fix everywhere manually – we will only have to change stuff in one place for all devices.

Another idea is to make the code easier to use for beginners – adding new devices with such an approach will be a pure joy – sometimes all one will have to do is just to change a number of buttons and specify some configuration settings.

Changes are fairly global, the process will take time – so I thought it’s time to create a separate branch for the most recent version. Please check out the new testing branch! I will be happy to hear some feedback in the comments.

Cheers!

2 Replies to “New “Testing” branch of the firmware!”

  1. Sir,
    Thank you for this excellent resource. This is such a great alternative to the incredibly overpriced flight control market.

    You may have already addressed this, but is there a 3D printer that you would recommend? What is the minimum print area required for the largest piece?

    Thank you again! Will definitely refer buddies to your project!

    1. Hi! Sorry for the late reply. A lot of guys seem to like Ender 3, the minimum recommended print volume is somewhat like 200x200x180 mm, but the bigger – the better =) Any Prusa3 clone should do just fine, no special requirements =)

      Please contact me on discord if you need help – hc625ma#8409

      Cheers!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.