some compatibility fixes and upload instructions
This commit is contained in:
parent
35d969aadd
commit
edd0246cc5
6 changed files with 43 additions and 7 deletions
|
|
@ -10,13 +10,13 @@
|
|||
#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 VERSION_STRING "Sangaboard Firmware v0.5" //TODO: temporarily using the same version string for sangaboard.py compatibility
|
||||
#define DEBUG_ON
|
||||
|
||||
//module choice
|
||||
#define HELP
|
||||
#define STAGE
|
||||
#define ENDSTOPS
|
||||
// #define ENDSTOPS
|
||||
// #define LIGHT_SENSOR
|
||||
|
||||
//module configs
|
||||
|
|
|
|||
27
src/main.cpp
27
src/main.cpp
|
|
@ -44,6 +44,7 @@ uint8_t registered_loop_fn_count = 0;
|
|||
|
||||
const Command core_commands[] = {
|
||||
{"version", get_version},
|
||||
{"list_modules", get_modules},
|
||||
END_COMMAND};
|
||||
|
||||
void register_module(const Command commands[], void (*loop_fn)(void))
|
||||
|
|
@ -95,10 +96,34 @@ uint8_t parse_arguments(char ** arguments, String command, uint8_t max_args)
|
|||
|
||||
void get_version(String)
|
||||
{
|
||||
Serial.println(F(VER_STRING));
|
||||
Serial.println(F(VERSION_STRING));
|
||||
return;
|
||||
}
|
||||
|
||||
void get_modules(String)
|
||||
{
|
||||
#if defined(LIGHTSENSOR) && defined(LIGHT_SENSOR_ADAFRUIT_TSL2591)
|
||||
Serial.println(F("Light Sensor: TSL2591"));
|
||||
#elif defined(LIGHTSENSOR) && defined(LIGHT_SENSOR_ADAFRUIT_ADS1115)
|
||||
Serial.println(F("Light Sensor: ADS1115"));
|
||||
#endif
|
||||
|
||||
#if defined(ENDSTOPS)
|
||||
Serial.print("Endstops:");
|
||||
#ifdef ENDSTOPS_MIN
|
||||
Serial.print(" min");
|
||||
#endif
|
||||
#ifdef ENDSTOPS_MAX
|
||||
Serial.print(" max");
|
||||
#endif
|
||||
#ifdef ENDSTOPS_SOFT
|
||||
Serial.print(" soft");
|
||||
#endif
|
||||
Serial.println();
|
||||
#endif
|
||||
Serial.println("--END--");
|
||||
}
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
void setup()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,5 +23,6 @@ uint8_t parse_arguments(char ** arguments, String, uint8_t);
|
|||
extern void register_module(const Command commands[], void (*loop_fn)(void));
|
||||
|
||||
void get_version(String);
|
||||
void get_modules(String);
|
||||
#define MAIN_H
|
||||
#endif
|
||||
|
|
@ -110,6 +110,7 @@ void start_move(long displ[n_motors])
|
|||
move_start_time = micros();
|
||||
final_scaled_t = (float)max_steps * min_step_delay; //NB total time taken will be final_scaled_t + 2*ramp_time
|
||||
stage_moving = true;
|
||||
Serial.println("done.");
|
||||
}
|
||||
|
||||
void stage_loop()
|
||||
|
|
@ -209,6 +210,7 @@ void stage_release(String command)
|
|||
{
|
||||
releaseMotor(i);
|
||||
}
|
||||
Serial.println("done");
|
||||
}
|
||||
|
||||
void stage_p(String command)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <Arduino.h>
|
||||
|
||||
#define EACH_MOTOR for (int i = 0; i < STAGE_N_MOTORS; i++)
|
||||
#define VER_STRING "Sangaboard Firmware v0.6"
|
||||
|
||||
void stage_setup();
|
||||
void stage_loop();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue