Bayley Wang / Mbed 2 deprecated foc-ed_in_the_bot_compact

Dependencies:   FastPWM3 mbed

Files at this revision

API Documentation at this revision

Comitter:
bwang
Date:
Sat Feb 10 06:35:52 2018 +0000
Parent:
195:b61a734eb50c
Child:
197:68fd01b73537
Commit message:
02/10/2017 01:35 - can now switch command source to terminal, added 'clear' command (which clears the screen on POSIX-compliant terminals)

Changed in this revision

BREMS/BREMSConfig.cpp Show annotated file Show diff for this revision Revisions of this file
BREMS/derived.h Show annotated file Show diff for this revision Revisions of this file
CHANGELOG.txt Show annotated file Show diff for this revision Revisions of this file
Calibration/Calibration.cpp Show annotated file Show diff for this revision Revisions of this file
Calibration/Calibration.h Show annotated file Show diff for this revision Revisions of this file
CommandProcessor/CommandProcessor.cpp Show annotated file Show diff for this revision Revisions of this file
CommandProcessor/CommandProcessor.h Show annotated file Show diff for this revision Revisions of this file
CommandProcessor/cmd_helpers.cpp Show annotated file Show diff for this revision Revisions of this file
CommandProcessor/cmd_mode.cpp Show annotated file Show diff for this revision Revisions of this file
CommandProcessor/cmd_sys.cpp Show annotated file Show diff for this revision Revisions of this file
hardware.h Show annotated file Show diff for this revision Revisions of this file
layout.h Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/BREMS/BREMSConfig.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/BREMS/BREMSConfig.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -7,7 +7,7 @@
 #include "PreferenceWriter.h"
 #include "Filter.h"
 
-#include "layout.h"
+#include "hardware.h"
 #include "derived.h"
 #include "prefs.h"
 #include "errors.h"
--- a/BREMS/derived.h	Sat Feb 10 06:09:42 2018 +0000
+++ b/BREMS/derived.h	Sat Feb 10 06:35:52 2018 +0000
@@ -6,7 +6,7 @@
 #ifndef __DERIVED_H
 #define __DERIVED_H
 
-#include "layout.h"
+#include "hardware.h"
 #include "prefs.h"
 
 /*max modulation depth at which inverter is still linear*/
--- a/CHANGELOG.txt	Sat Feb 10 06:09:42 2018 +0000
+++ b/CHANGELOG.txt	Sat Feb 10 06:35:52 2018 +0000
@@ -38,4 +38,5 @@
 02/09/2018 22:41 - removed ROW, COLUMNS from configurable values, for now. removed a bunch of extra #include's
 02/09/2018 22:58 - everything but main.cpp and friends moved to flash configuration
 02/10/2018 00:35 - added fancy masked error system
-02/10/2018 01:05 - everything configured through flash variables, started adding support for operating modes
\ No newline at end of file
+02/10/2018 01:05 - everything configured through flash variables, started adding support for operating modes
+02/10/2017 01:35 - can now switch command source to terminal, added 'clear' command (which clears the screen on POSIX-compliant terminals)
\ No newline at end of file
--- a/Calibration/Calibration.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/Calibration/Calibration.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -5,7 +5,7 @@
 #include "MathHelpers.h"
 #include "Transforms.h"
 
-#include "layout.h"
+#include "hardware.h"
 #include "derived.h"
 #include "prefs.h"
 
--- a/Calibration/Calibration.h	Sat Feb 10 06:09:42 2018 +0000
+++ b/Calibration/Calibration.h	Sat Feb 10 06:35:52 2018 +0000
@@ -1,4 +1,4 @@
-#include "layout.h"
+#include "hardware.h"
 #include "BREMSStructs.h"
 
 void calibrate_position(IOStruct *io);
\ No newline at end of file
--- a/CommandProcessor/CommandProcessor.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/CommandProcessor/CommandProcessor.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -20,6 +20,7 @@
         if (strcmp(tokens[0], "zero") == 0) cmd_mode(pc, tokens[0]);
         if (strcmp(tokens[0], "wizard") == 0) cmd_mode(pc, tokens[0]);
         if (strcmp(tokens[0], "exit") == 0) cmd_exit(pc);
+        if (strcmp(tokens[0], "clear") == 0) cmd_clear(pc);
         break;
     case 2:
         if (strcmp(tokens[0], "ls") == 0) cmd_ls2(pc, tokens[1]);
--- a/CommandProcessor/CommandProcessor.h	Sat Feb 10 06:09:42 2018 +0000
+++ b/CommandProcessor/CommandProcessor.h	Sat Feb 10 06:35:52 2018 +0000
@@ -24,6 +24,9 @@
 /*---variable commands---*/
 void cmd_exit(Serial *pc);
 
+/*---system commands---*/
+void cmd_clear(Serial *pc);
+
 /*---internal functions---*/
 int tokenize(char *buf, char **out, int max);
 float *checkf(char *s);
--- a/CommandProcessor/cmd_helpers.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/CommandProcessor/cmd_helpers.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -3,7 +3,7 @@
 #include "PreferenceWriter.h"
 
 #include "globals.h"
-#include "layout.h"
+#include "hardware.h"
 #include "defaults.h"
 #include "derived.h"
 #include "prefs.h"
--- a/CommandProcessor/cmd_mode.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/CommandProcessor/cmd_mode.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -5,7 +5,7 @@
 #include "prefs.h"
 #include "globals.h"
 
-#include "layout.h"
+#include "hardware.h"
 #include "defaults.h"
 #include "derived.h"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CommandProcessor/cmd_sys.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -0,0 +1,6 @@
+#include "mbed.h"
+#include "CommandProcessor.h"
+
+void cmd_clear(Serial *pc) {
+    pc->printf("\e[1;1H\e[2J");
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hardware.h	Sat Feb 10 06:35:52 2018 +0000
@@ -0,0 +1,35 @@
+#ifndef __LAYOUT_H
+#define __LAYOUT_H
+
+#define PWMA PA_8
+#define PWMB PA_9
+#define PWMC PA_10
+#define EN PB_15
+
+#define IA PA_4
+#define IB PB_0
+
+#define TH_PIN PB_8
+
+#define LOG_TX PC_10
+#define LOG_RX PC_11
+
+#define I_SCALE_RAW 25.0f //mv/A
+#define R_UP 12000.0f //ohms
+#define R_DOWN 3600.0f //ohms
+#define R_BIAS 3600.0f //ohms
+#define AVDD 3300.0f //mV
+
+/*allows for inverting power modules*/
+#define set_dtc(phase, value) *phase = (value)
+
+/*inverter linearity limit*/
+#define LINEAR_DTC_MAX 0.945f
+
+//don't change these!
+#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
+#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
+
+#define PI 3.141593f
+
+#endif
\ No newline at end of file
--- a/layout.h	Sat Feb 10 06:09:42 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#ifndef __LAYOUT_H
-#define __LAYOUT_H
-
-#define PWMA PA_8
-#define PWMB PA_9
-#define PWMC PA_10
-#define EN PB_15
-
-#define IA PA_4
-#define IB PB_0
-
-#define TH_PIN PB_8
-
-#define LOG_TX PC_10
-#define LOG_RX PC_11
-
-#define I_SCALE_RAW 25.0f //mv/A
-#define R_UP 12000.0f //ohms
-#define R_DOWN 3600.0f //ohms
-#define R_BIAS 3600.0f //ohms
-#define AVDD 3300.0f //mV
-
-/*allows for inverting power modules*/
-#define set_dtc(phase, value) *phase = (value)
-
-/*inverter linearity limit*/
-#define LINEAR_DTC_MAX 0.945f
-
-//don't change these!
-#define I_OFFSET (AVDD * R_DOWN * R_UP / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
-#define I_SCALE (R_BIAS * R_DOWN * I_SCALE_RAW / (R_DOWN * R_UP + R_BIAS * (R_DOWN + R_UP)))
-
-#define PI 3.141593f
-
-#endif
\ No newline at end of file
--- a/main.cpp	Sat Feb 10 06:09:42 2018 +0000
+++ b/main.cpp	Sat Feb 10 06:35:52 2018 +0000
@@ -15,7 +15,7 @@
 #include "BREMSConfig.h"
 
 #include "prefs.h"
-#include "layout.h"
+#include "hardware.h"
 #include "derived.h"
 #include "main.h"