Add endstops, light_sensor, test, many fixes

- Added endstop and light_sensor module
 - Improved configuration by splitting wiring configs to boards.h
 - Added a unit test for argument parsing
 - Fixed many smaller bugs
This commit is contained in:
Filip Ayazi 2021-05-25 01:40:09 +01:00
parent 8f66bb7da9
commit 35d969aadd
16 changed files with 875 additions and 64 deletions

View file

@ -1,27 +1,45 @@
#ifndef CONFIGURED
//board choice
#define BOARD_AUTO
//#define BOARD_SANGABOARDv3
//#define BOARD_SANGABOARDv2
//#define BOARD_CUSTOM
#include <boards.h> //defines wiring
//general settings
#define MAX_COMMANDS 50
#define MAX_MODULES 10
#define MAX_ARGUMENT_LENGTH 20 //used in argument parsing, takes up ram
#define VERSION_STRING "Sangaboard Firmware v0.6"
#define DEBUG_ON
//module choice
#define HELP
#define STAGE
#define ENDSTOPS
// #define LIGHT_SENSOR
//module configs
#ifdef STAGE
//TODO: Fix this for platformio
#ifdef ARDUINO_AVR_LEONARDO
#define SANGABOARDv3
#define BOARD_STRING "Sangaboard v0.3"
#elif ARDUINO_AVR_SANGABOARD
#define SANGABOARDv3
#define BOARD_STRING "Sangaboard v0.3"
#else
#define SANGABOARDv2
#define BOARD_STRING "Sangaboard v0.2"
#define STAGE_N_MOTORS 3
#endif
#ifdef ENDSTOPS
#define ENDSTOPS_MIN
//#define ENDSTOPS_MAX
#if defined(ENDSTOPS_MIN) || defined(ENDSTOPS_MAX)
//endstops are closed when the pin is down by default, this inverts the behaviour
//soft endstops trigger when 0/MAX is reached in the direction without endstops
#define ENDSTOPS_SOFT
#endif
#endif
#define LIGHT_SENSOR_ADAFRUIT_TSL2591
//#define LIGHT_SENSOR_ADAFRUIT_ADS1115
//config for non-standard platforms
#ifndef MCU_PICO
#define SUPPORT_EEPROM
#endif
#define CONFIGURED
#endif