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.
Dependencies: mbed
Diff: src/command.cpp
- Revision:
- 12:fd1fd1857628
- Parent:
- 11:01dcfb29fbc4
- Child:
- 14:e55ae9bb2a81
--- a/src/command.cpp Fri Dec 07 20:42:41 2018 +0000 +++ b/src/command.cpp Sat Dec 08 01:53:36 2018 +0000 @@ -73,8 +73,6 @@ } } - - /************************************************************ * Routine: gethex * Input: hex character @@ -692,29 +690,36 @@ { menuRedraw(NO_PROMPT); } + else if (!strcmp(commandString, "BUCK")) + { + buck = TRUE; + } + else if (!strcmp(commandString, "BOOST")) + { + buck = FALSE; + } else if (!strcmp(commandString, "BRDS")) // BRDS is used to get/set the wr_out value. // The integer value of boardsActive is used to change wr_out via setBoardEnables(boardsActive). // Slots 12 to 0 are activated with the wr_out signals // wr_out[13] = slots[12:0] { - - boardsActive = commandData; - if (readback) { sprintf(strbuf, " %d", boardsActive); sendSerial(strbuf); } - //else if (running == 1) - //{ - // sprintf(strbuf, " Parameters may not be updated while running!"); - // sendSerial(strbuf); - //} + else if (running == 1) + { + sprintf(strbuf, " Parameters may not be updated while running!"); + sendSerial(strbuf); + } else { - if(checkRange(boardsActive, 0, 63) == 1){ - en_out_code = setBoardWeights(boardsActive); + boardsActive = commandData; + if(checkRange(boardsActive, 0, 8191) == 1){ + wr_out_code = setBoardEnables(boardsActive); + testing = TRUE; }else{ showRangeError(1, boardsActive, 0.0); } @@ -726,22 +731,22 @@ // en_out are binary weighted signals that activate groups of DC-DC converters on the slot cards. // en_out[6] = {en32, en16, en8, en4, en2, en1} { - boardMults = commandData; - if (readback) { sprintf(strbuf, " %d", boardMults); sendSerial(strbuf); } - //else if (running == 1) - //{ - // sprintf(strbuf, " Parameters may not be updated while running!"); - // sendSerial(strbuf); - //} + else if (running == 1) + { + sprintf(strbuf, " Parameters may not be updated while running!"); + sendSerial(strbuf); + } else { + boardMults = commandData; if(checkRange(boardMults, 0, 63) == 1){ en_out_code = setBoardWeights(boardMults); + testing = TRUE; }else{ showRangeError(1, boardMults, 0.0); } @@ -753,8 +758,6 @@ // en_out are binary weighted signals that activate groups of DC-DC converters on the slot cards. // en_out[6] = {en32, en16, en8, en4, en2, en1} { - my12 = commandData; - //if(DEBUG){ // sprintf(strbuf, "my12=%d commandData=%d\r\n", my12, commandData); // sendSerial(strbuf); @@ -764,12 +767,16 @@ { sprintf(strbuf, " %d", my12); sendSerial(strbuf); + }else{ + my12 = commandData; + testing = FALSE; } } else if (!strcmp(commandString, "ALLOFF")) { my12 = 0; running = FALSE; + testing = FALSE; if(DEBUG){ sprintf(strbuf, "wr_out_code=%d\r\n", wr_out_code); sendSerial(strbuf); @@ -778,6 +785,7 @@ else if (!strcmp(commandString, "ALLON")) { wr_out_code = setBoardEnables((unsigned int)ALLON); + testing = TRUE; } else if (!strcmp(commandString, "RUN")) { @@ -787,12 +795,14 @@ if(rxbuf[bufloc] == NULL){ boardsActive = 1; startConverter(boardsActive); + testing = FALSE; } else if (rxbuf[bufloc] == '0') //if (rxbuf[bufloc] == '0') { stopConverter(); //setDacsToZeroVolts(); + testing = FALSE; } else if ((rxbuf[bufloc] > '0') && (rxbuf[bufloc] < '0' + MAX_BOARDS)) { @@ -803,6 +813,7 @@ { boardsActive = ival; startConverter(boardsActive); + testing = FALSE; } else { @@ -831,6 +842,8 @@ else if (!strcmp(commandString, "STOP")) { stopConverter(); + testing = FALSE; + my12 = 0; //hv_en = OFF; } else if(!strcmp(commandString, "TEST"))