Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: DRIVERS/CHEM_BOX_COMMON.cpp
- Revision:
- 2:73a028278c5c
- Parent:
- 1:d64ac853223c
- Child:
- 3:cb48919cd5e8
diff -r d64ac853223c -r 73a028278c5c DRIVERS/CHEM_BOX_COMMON.cpp
--- a/DRIVERS/CHEM_BOX_COMMON.cpp Thu Aug 06 15:02:29 2015 +0000
+++ b/DRIVERS/CHEM_BOX_COMMON.cpp Mon Aug 31 13:00:37 2020 +0000
@@ -6,6 +6,8 @@
//Mbed Objects
+DigitalOut MBED_LED1(LED1);
+
DigitalOut AIO_ADC1_CS(p30);
DigitalOut AIO_ADC2_CS(p29);
@@ -46,6 +48,8 @@
//Local Variables
+static uint8_t TerminalEcho = 1;
+
static uint8_t HeaterBits = 0;
static uint16_t SolenoidBits = 0;
@@ -226,22 +230,22 @@
MCU_SR_LOAD = 0;
}
-//Make sure to call ReadThermocouple befor eyou call this so internal variables are updated
+//Make sure to call ReadThermocouple before you call this so internal variables are updated
uint16_t ReadThermocouple_OC()
{
return Thermocouple_OC;
}
-//Make sure to call ReadThermocouple befor eyou call this so internal variables are updated
+//Make sure to call ReadThermocouple before you call this so internal variables are updated
uint16_t ReadThermocouple_SCG()
{
return Thermocouple_SCG;
}
-//Make sure to call ReadThermocouple befor eyou call this so internal variables are updated
+//Make sure to call ReadThermocouple before you call this so internal variables are updated
uint16_t ReadThermocouple_SCV()
{
return Thermocouple_SCV;
}
-//Make sure to call ReadThermocouple befor eyou call this so internal variables are updated
+//Make sure to call ReadThermocouple before you call this so internal variables are updated
uint16_t ReadThermocouple_FAULT()
{
return Thermocouple_FAULT;
@@ -500,6 +504,7 @@
void TerminalCmd_MFCOFF(char *arg);
void TerminalCmd_AOUT(char *arg);
void TerminalCmd_Reset(char *arg);
+void TerminalCmd_ECHO_OFF(char *arg);
//Populate this array with the callback functions and their terminal command string
TerminalCallbackRecord MyTerminalCallbackRecords[] ={ {"reset",TerminalCmd_Reset,"Resets the CHEM box"},
@@ -542,7 +547,9 @@
{"MFCON",TerminalCmd_MFCON,"Turns on the MFC power"},
- {"MFCOFF",TerminalCmd_MFCOFF,"Turns off the MFC power"}
+ {"MFCOFF",TerminalCmd_MFCOFF,"Turns off the MFC power"},
+
+ {"ECHO_OFF",TerminalCmd_ECHO_OFF,"Disables echoing of characters"}
};
@@ -553,11 +560,18 @@
mbed_reset();
}
+
+
void TerminalCmd_Stub(char *arg)
{
PC.printf("stub \r\n");
}
+void TerminalCmd_ECHO_OFF(char *arg)
+{
+ TerminalEcho = 0;
+}
+
void TerminalCmd_MFCI(char *arg)
{
int Channel = -1;
@@ -846,11 +860,13 @@
void TerminalCmd_FanOn(char *arg)
{
SetFanSpeed(100); //PWMing the FANs doesn't work with the ME40100V1 models! WE will just on or off
+ MBED_LED1 = 1;
}
void TerminalCmd_FanOff(char *arg)
{
SetFanSpeed(0); //PWMing the FANs doesn't work with the ME40100V1 models! WE will just on or off
+ MBED_LED1 = 0;
}
void TerminalCmd_Fan(char *arg)
@@ -991,8 +1007,12 @@
case '\r':
TerminalLineBuf[TerminalPos++] = 0x0;
- PC.putc(NextCharIn);
-
+
+ if(TerminalEcho)
+ {
+ PC.putc(NextCharIn);
+ }
+
if(TerminalPos > 1)
{
//find the command
@@ -1061,7 +1081,7 @@
}
}
- PC.printf("\r\n>");
+ PC.printf("\r\n");
TerminalPos = 0;
break;
@@ -1069,8 +1089,11 @@
case '\b':
if(TerminalPos > 0)
{
- TerminalPos--;
- PC.putc(NextCharIn);
+ TerminalPos--;
+ if(TerminalEcho)
+ {
+ PC.putc(NextCharIn);
+ }
}
break;
@@ -1086,7 +1109,10 @@
if(TerminalPos < MAX_TERMINAL_LINE_CHARS-1)
{
TerminalLineBuf[TerminalPos++] = NextCharIn;
- PC.putc(NextCharIn);
+ if(TerminalEcho)
+ {
+ PC.putc(NextCharIn);
+ }
}
}
