This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a rather contrived example where one option | |
expressed as an enum leads to a second set of options | |
that's different for each initial option. | |
What I really have in mind is configuration of a peripheral on microcontroller. | |
E.g. you first choose serial port 1, and then that gives you some options for | |
the TX and RX pins which are specific to serial port 1. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
constexpr int DRV_IN1 = PIN_B0; | |
constexpr int DRV_IN2 = PIN_B1; | |
constexpr int DRV_IN3 = PIN_B2; | |
constexpr int DRV_IN4 = PIN_B5; | |
class Winding { | |
public: | |
const int pin1, pin2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess, argparse, sys, pprint, json | |
from os import path | |
# Read the output of Chibios build to generate .vscode/c_cpp_properties.json | |
# E.g. make | python c_cpp_properties.py -C arm-none-eabi-g++ > .vscode/c_cpp_properties.json | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-C', '--compiler', dest='compiler', default='gcc') |