Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL

Dependencies:   mbed

Committer:
mfwic
Date:
Tue Jan 15 01:32:33 2019 +0000
Revision:
22:2c37ac12746e
Parent:
20:5de24e4ae1c5
Child:
23:318f52616b3b
Added hysteresis; Changed LUT to use v12*i12 instead of just i12.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mfwic 1:9f8583ba2431 1 //-------------------------------------------------------------------------------
mfwic 1:9f8583ba2431 2 //
mfwic 1:9f8583ba2431 3 // Treehouse Inc.
mfwic 1:9f8583ba2431 4 // Colorado Springs, Colorado
mfwic 1:9f8583ba2431 5 //
mfwic 1:9f8583ba2431 6 // Copyright (c) 2016 by Treehouse Designs Inc.
mfwic 1:9f8583ba2431 7 //
mfwic 1:9f8583ba2431 8 // This code is the property of Treehouse, Inc. (Treehouse) and may not be redistributed
mfwic 1:9f8583ba2431 9 // in any form without prior written permission from the copyright holder, Treehouse.
mfwic 1:9f8583ba2431 10 //
mfwic 1:9f8583ba2431 11 // The above copyright notice and this permission notice shall be included in
mfwic 1:9f8583ba2431 12 // all copies or substantial portions of the Software.
mfwic 1:9f8583ba2431 13 //
mfwic 1:9f8583ba2431 14 //-------------------------------------------------------------------------------
mfwic 1:9f8583ba2431 15 //
mfwic 1:9f8583ba2431 16 // REVISION HISTORY:
mfwic 1:9f8583ba2431 17 //
mfwic 1:9f8583ba2431 18 // $Author: $
mfwic 1:9f8583ba2431 19 // $Rev: $
mfwic 1:9f8583ba2431 20 // $Date: $
mfwic 1:9f8583ba2431 21 // $URL: $
mfwic 1:9f8583ba2431 22 //
mfwic 1:9f8583ba2431 23 //-------------------------------------------------------------------------------
mfwic 1:9f8583ba2431 24
mfwic 1:9f8583ba2431 25 #include "mbed.h"
mfwic 6:39442d493098 26 #include "globals.h"
mfwic 1:9f8583ba2431 27 #include "serial.h"
mfwic 1:9f8583ba2431 28 #include "menu.h"
mfwic 11:01dcfb29fbc4 29 #include "adc.h"
mfwic 15:aed8f326c949 30 #include "boards.h"
mfwic 6:39442d493098 31 #include "Ticker.h"
mfwic 15:aed8f326c949 32 #include "stdlib.h"
mfwic 18:78e982f31c6b 33 #include "lut.h"
mfwic 1:9f8583ba2431 34
mfwic 6:39442d493098 35 Ticker drt;
mfwic 7:860b3a8275cb 36 unsigned int oldTime=0;
mfwic 6:39442d493098 37
mfwic 6:39442d493098 38 /*******************************************************************************
mfwic 6:39442d493098 39 drtInt - Display Refresh Timer interrupt handler
mfwic 6:39442d493098 40 *******************************************************************************/
mfwic 6:39442d493098 41 // real time clock interrupt to flash the LED
mfwic 6:39442d493098 42 void drtInt(void)
mfwic 6:39442d493098 43 {
mfwic 6:39442d493098 44 updateReady = TRUE;
mfwic 6:39442d493098 45 }
mfwic 6:39442d493098 46
mfwic 6:39442d493098 47 /*******************************************************************************
mfwic 6:39442d493098 48 initDRT - Create Display Refresh Timer interrupt
mfwic 6:39442d493098 49 *******************************************************************************/
mfwic 6:39442d493098 50 // initialize display refresh timer (DRT)
mfwic 6:39442d493098 51 void initDRT(void)
mfwic 6:39442d493098 52 {
mfwic 6:39442d493098 53 drt.attach_us(&drtInt, UPDATE_REFRESH_DELAY_US);
mfwic 6:39442d493098 54 }
mfwic 6:39442d493098 55
mfwic 6:39442d493098 56 /*******************************************************************************
mfwic 15:aed8f326c949 57 refreshStatus - Refresh status info to the terminal
mfwic 15:aed8f326c949 58 *******************************************************************************/
mfwic 15:aed8f326c949 59 void refreshStatus(struct statusValues statVals){
mfwic 15:aed8f326c949 60
mfwic 16:5791665200cb 61 char strbuf_mode[15] = {0};
mfwic 16:5791665200cb 62 char strbuf_running[16] = {0};
mfwic 16:5791665200cb 63 char strbuf_v48[15] = {0};
mfwic 16:5791665200cb 64 char strbuf_v24[15] = {0};
mfwic 16:5791665200cb 65 char strbuf_v12[15] = {0};
mfwic 16:5791665200cb 66 char strbuf_blank[50] = {0};
mfwic 16:5791665200cb 67
mfwic 15:aed8f326c949 68 if(buck){
mfwic 16:5791665200cb 69 sprintf(strbuf_mode, "Buck Mode | ");
mfwic 15:aed8f326c949 70 }else{
mfwic 16:5791665200cb 71 sprintf(strbuf_mode, "Boost Mode | ");
mfwic 15:aed8f326c949 72 }
mfwic 16:5791665200cb 73 //sendSerial(strbuf);
mfwic 16:5791665200cb 74
mfwic 16:5791665200cb 75 if(running){
mfwic 16:5791665200cb 76 sprintf(strbuf_running, "Running | ");
mfwic 16:5791665200cb 77 }else{
mfwic 16:5791665200cb 78 sprintf(strbuf_running, "NOT Running | ");
mfwic 16:5791665200cb 79 }
mfwic 16:5791665200cb 80 //sendSerial(strbuf);
mfwic 15:aed8f326c949 81
mfwic 15:aed8f326c949 82 if(statVals.V48_IS_HI){
mfwic 16:5791665200cb 83 sprintf(strbuf_v48, "V48 HIGH | ");
mfwic 15:aed8f326c949 84 }else if(statVals.V48_IS_LO){
mfwic 16:5791665200cb 85 sprintf(strbuf_v48, "V48 LOW | ");
mfwic 15:aed8f326c949 86 }else{
mfwic 16:5791665200cb 87 // sprintf(strbuf, "V48 OK | ");
mfwic 16:5791665200cb 88 sprintf(strbuf_v48, "");
mfwic 16:5791665200cb 89 sprintf(strbuf_blank, " ");
mfwic 15:aed8f326c949 90 }
mfwic 16:5791665200cb 91 //sendSerial(strbuf);
mfwic 15:aed8f326c949 92
mfwic 15:aed8f326c949 93 if(statVals.V24_IS_HI){
mfwic 16:5791665200cb 94 sprintf(strbuf_v24, "V24 HIGH | ");
mfwic 15:aed8f326c949 95 }else if(statVals.V24_IS_LO){
mfwic 16:5791665200cb 96 sprintf(strbuf_v24, "V24 LOW | ");
mfwic 15:aed8f326c949 97 }else{
mfwic 16:5791665200cb 98 // sprintf(strbuf, "V24 OK | ");
mfwic 16:5791665200cb 99 sprintf(strbuf_v24, "");
mfwic 16:5791665200cb 100 sprintf(strbuf_blank, strcat(strbuf_blank, " "));
mfwic 15:aed8f326c949 101 }
mfwic 16:5791665200cb 102 //sendSerial(strbuf);
mfwic 15:aed8f326c949 103
mfwic 15:aed8f326c949 104 if(statVals.V12_IS_HI){
mfwic 16:5791665200cb 105 sprintf(strbuf_v12, "V12 HIGH ");
mfwic 15:aed8f326c949 106 }else if(statVals.V24_IS_LO){
mfwic 16:5791665200cb 107 sprintf(strbuf_v12, "V12 LOW ");
mfwic 15:aed8f326c949 108 }else{
mfwic 16:5791665200cb 109 // sprintf(strbuf, "V12 OK | ");
mfwic 16:5791665200cb 110 sprintf(strbuf_v12, "");
mfwic 16:5791665200cb 111 sprintf(strbuf_blank, strcat(strbuf_blank, " "));
mfwic 15:aed8f326c949 112 }
mfwic 16:5791665200cb 113 //sendSerial(strbuf);
mfwic 15:aed8f326c949 114
mfwic 16:5791665200cb 115 //move cursor to STATUS_ROW and write status info
mfwic 16:5791665200cb 116 //char row = STATUS_ROW + '0';
mfwic 16:5791665200cb 117 sprintf( strbuf, "%c[9;0f", 27); // ESC=27, Move cursor position = [line;columnf
mfwic 16:5791665200cb 118 sendSerial(strbuf);
mfwic 15:aed8f326c949 119
mfwic 22:2c37ac12746e 120 //sprintf(strbuf, "Status: %s%s%s%s%s%s\r\n\r\n", strbuf_mode, strbuf_running, strbuf_v48, strbuf_v24, strbuf_v12, strbuf_blank);
mfwic 22:2c37ac12746e 121 sprintf(strbuf, "Status: %s%s%s%s%s%d \r\n\r\n", strbuf_mode, strbuf_running, strbuf_v48, strbuf_v24, strbuf_v12, row_print);
mfwic 15:aed8f326c949 122 sendSerial(strbuf);
mfwic 15:aed8f326c949 123
mfwic 15:aed8f326c949 124 }
mfwic 15:aed8f326c949 125
mfwic 15:aed8f326c949 126 /*******************************************************************************
mfwic 6:39442d493098 127 refreshData - Refresh voltage and current readings to the terminal
mfwic 6:39442d493098 128 *******************************************************************************/
mfwic 15:aed8f326c949 129 void refreshData(struct adcValues adcVals){
mfwic 8:d3d7dca419b3 130 //loopTime = masterTimer.read_ms() - oldTime;
mfwic 8:d3d7dca419b3 131 //oldTime = masterTimer.read_ms();
mfwic 8:d3d7dca419b3 132
mfwic 15:aed8f326c949 133 struct displayValues dvals = calcDisplayValues(adcVals);
mfwic 7:860b3a8275cb 134
mfwic 11:01dcfb29fbc4 135 double pwr_out=dvals.v12f*dvals.i12f;
mfwic 12:fd1fd1857628 136 double pwr_in=dvals.v48f*(dvals.i48f);
mfwic 7:860b3a8275cb 137 double pwr_eff=100*pwr_out/pwr_in;
mfwic 7:860b3a8275cb 138
mfwic 16:5791665200cb 139 //move cursor to DATA_ROW and write data
mfwic 16:5791665200cb 140 //row = DATA_ROW + '0';
mfwic 16:5791665200cb 141 sprintf( strbuf, "%c[10;0f", 27); // ESC=27, Move cursor position = [line;columnf
mfwic 16:5791665200cb 142 sendSerial(strbuf);
mfwic 16:5791665200cb 143
mfwic 18:78e982f31c6b 144 sprintf(strbuf, "V48=%2.1f, I48=%3.1f | V24=%2.1f, I24=%3.1f | V12=%2.1f, I12=%3.2f \r\n", dvals.v48f, dvals.i48f, dvals.v24f, dvals.i24f, dvals.v12f, dvals.i12f);
mfwic 8:d3d7dca419b3 145 //sprintf(strbuf, "V48=%2.1f, I48=%2.2f | V24=%2.1f, I24=%2.2f | V12=%2.1f, I12=%2.2f || loop=%d \r\n", v48f, i48f, v24f, i24f, v12f, i12f, loopTime);
mfwic 7:860b3a8275cb 146 sendSerial(strbuf);
mfwic 18:78e982f31c6b 147 //sprintf(strbuf, "adcVals.i12 = %d \r\n", adcVals.i12);
mfwic 18:78e982f31c6b 148 //sendSerial(strbuf);
mfwic 8:d3d7dca419b3 149 sprintf(strbuf, "Power Out = %4.1f W, Power In = %4.1f W \r\n", pwr_out, pwr_in);
mfwic 7:860b3a8275cb 150 sendSerial(strbuf);
mfwic 7:860b3a8275cb 151 sprintf( strbuf, "%c[34m", 27 ); // ESC=27, Blue Text
mfwic 7:860b3a8275cb 152 sendSerial(strbuf);
mfwic 8:d3d7dca419b3 153 sprintf(strbuf, "Power Efficiency = %2.2f percent \r\n\r\n", pwr_eff);
mfwic 7:860b3a8275cb 154 sendSerial(strbuf);
mfwic 7:860b3a8275cb 155 sprintf( strbuf, "%c[30m", 27 ); // ESC=27, White Text
mfwic 6:39442d493098 156 sendSerial(strbuf);
mfwic 18:78e982f31c6b 157 sprintf(strbuf, "BRDS_code=%d, MULT_code=%d \r\n", wr_out_code, en_out_code);
mfwic 6:39442d493098 158 sendSerial(strbuf);
mfwic 6:39442d493098 159 }
mfwic 6:39442d493098 160
mfwic 6:39442d493098 161 /*******************************************************************************
mfwic 6:39442d493098 162 updateTerminal - Save cursor, write data, restore cursor.
mfwic 6:39442d493098 163 *******************************************************************************/
mfwic 15:aed8f326c949 164 void updateTerminal(struct adcValues adcVals, struct statusValues statVals){
mfwic 6:39442d493098 165 //get cursor pos, store in CUR_POS
mfwic 6:39442d493098 166 sprintf( strbuf, "%c7", 27 ); // ESC=27, Save cursor position = [s
mfwic 6:39442d493098 167 sendSerial(strbuf);
mfwic 15:aed8f326c949 168
mfwic 15:aed8f326c949 169 refreshStatus(statVals);
mfwic 15:aed8f326c949 170 refreshData(adcVals);
mfwic 15:aed8f326c949 171
mfwic 6:39442d493098 172 //move cursor to CUR_POS
mfwic 6:39442d493098 173 sprintf( strbuf, "%c8", 27 ); // ESC=27, Save cursor position = [s
mfwic 6:39442d493098 174 sendSerial(strbuf);
mfwic 6:39442d493098 175 }
mfwic 6:39442d493098 176
mfwic 6:39442d493098 177 /*******************************************************************************
mfwic 6:39442d493098 178 clrScrn - clears terminal and moves cursor to upper-left corner
mfwic 6:39442d493098 179 *******************************************************************************/
mfwic 1:9f8583ba2431 180 // clears terminal
mfwic 1:9f8583ba2431 181 void clrScrn(void){
mfwic 1:9f8583ba2431 182 sprintf( strbuf, "%c[2J", 27 ); // ESC=27, Clear screen = [2J
mfwic 1:9f8583ba2431 183 sendSerial(strbuf);
mfwic 1:9f8583ba2431 184 sprintf( strbuf, "%c[f", 27 ); // ESC=27, Move cursor to upper-left corner = [f
mfwic 1:9f8583ba2431 185 sendSerial(strbuf);
mfwic 1:9f8583ba2431 186 }
mfwic 1:9f8583ba2431 187
mfwic 6:39442d493098 188 /*******************************************************************************
mfwic 6:39442d493098 189 menuRedraw - Write menu to terminal
mfwic 6:39442d493098 190 *******************************************************************************/
mfwic 1:9f8583ba2431 191 // clears terminal and re-draws main menu
mfwic 8:d3d7dca419b3 192 void menuRedraw(bool prompt){
mfwic 1:9f8583ba2431 193 clrScrn();
mfwic 16:5791665200cb 194 menu_banner();
mfwic 7:860b3a8275cb 195
mfwic 7:860b3a8275cb 196 sprintf( strbuf, "%c[34m", 27 ); // ESC=27, Blue Text
mfwic 7:860b3a8275cb 197 sendSerial(strbuf);
mfwic 7:860b3a8275cb 198
mfwic 22:2c37ac12746e 199 sprintf(strbuf, " Agility Power Systems DCM1 v0.95 LUT v%1.3f\r\n\r\n", LUT_VER);
mfwic 7:860b3a8275cb 200 sendSerial(strbuf);
mfwic 7:860b3a8275cb 201
mfwic 7:860b3a8275cb 202 sprintf( strbuf, "%c[0m", 27 ); // ESC=27, Normal
mfwic 7:860b3a8275cb 203 sendSerial(strbuf);
mfwic 18:78e982f31c6b 204 sprintf( strbuf, "%c[30m", 27 ); // ESC=27, Black Text
mfwic 1:9f8583ba2431 205 sendSerial(strbuf);
mfwic 6:39442d493098 206
mfwic 15:aed8f326c949 207 struct adcValues adcVals = getADCresults();
mfwic 15:aed8f326c949 208 struct statusValues statVals = checkLevels(adcVals);
mfwic 15:aed8f326c949 209 refreshStatus(statVals);
mfwic 15:aed8f326c949 210 refreshData(adcVals);
mfwic 6:39442d493098 211
mfwic 16:5791665200cb 212 sprintf(strbuf, "\r\nCommands: (Not Case-Sensitive)");
mfwic 16:5791665200cb 213 sendSerial(strbuf);
mfwic 18:78e982f31c6b 214 sprintf(strbuf, "\r\n MENU");
mfwic 18:78e982f31c6b 215 sendSerial(strbuf);
mfwic 12:fd1fd1857628 216 sprintf(strbuf, "\r\n BRDS");
mfwic 1:9f8583ba2431 217 sendSerial(strbuf);
mfwic 12:fd1fd1857628 218 sprintf(strbuf, "\r\n MULT");
mfwic 1:9f8583ba2431 219 sendSerial(strbuf);
mfwic 8:d3d7dca419b3 220 sprintf(strbuf, "\r\n ALLOFF");
mfwic 1:9f8583ba2431 221 sendSerial(strbuf);
mfwic 16:5791665200cb 222 sprintf(strbuf, "\r\n RUN");
mfwic 16:5791665200cb 223 sendSerial(strbuf);
mfwic 16:5791665200cb 224 sprintf(strbuf, "\r\n STOP\r\n");
mfwic 16:5791665200cb 225 sendSerial(strbuf);
mfwic 16:5791665200cb 226 sprintf(strbuf, "\r\n Type \'=number\' after BRDS or MULT to enter value.");
mfwic 1:9f8583ba2431 227 sendSerial(strbuf);
mfwic 18:78e982f31c6b 228 sprintf(strbuf, "\r\n e.g. BRDS=4095 will enable all boards.\r\n");
mfwic 16:5791665200cb 229 sendSerial(strbuf);
mfwic 16:5791665200cb 230 sprintf(strbuf, "\r\n Type \'?\' at end of BRDS or MULT to get status.");
mfwic 16:5791665200cb 231 sendSerial(strbuf);
mfwic 16:5791665200cb 232 sprintf(strbuf, "\r\n e.g. BRDS? will print value of BRDS.\r\n");
mfwic 1:9f8583ba2431 233 sendSerial(strbuf);
mfwic 3:d8948c5b2951 234
mfwic 8:d3d7dca419b3 235 if(prompt){
mfwic 8:d3d7dca419b3 236 menuPrompt(MENU_DCM1);
mfwic 8:d3d7dca419b3 237 }
mfwic 3:d8948c5b2951 238 }
mfwic 3:d8948c5b2951 239
mfwic 6:39442d493098 240 /*******************************************************************************
mfwic 15:aed8f326c949 241 sendLevelsWarning
mfwic 15:aed8f326c949 242 *******************************************************************************/
mfwic 15:aed8f326c949 243 void sendLevelsWarning(void){
mfwic 15:aed8f326c949 244 sprintf(strbuf, "\r\nSome voltage levels are out of range. I would look into it if I were you.\r\n");
mfwic 15:aed8f326c949 245 sendSerial(strbuf);
mfwic 15:aed8f326c949 246 }
mfwic 15:aed8f326c949 247
mfwic 15:aed8f326c949 248 /*******************************************************************************
mfwic 6:39442d493098 249 menuPrompt - Write menu prompt to terminal
mfwic 6:39442d493098 250 *******************************************************************************/
mfwic 3:d8948c5b2951 251 // sends carriage return and linefeed and prompt character
mfwic 3:d8948c5b2951 252 void menuPrompt(int menuType)
mfwic 3:d8948c5b2951 253 {
mfwic 3:d8948c5b2951 254 char strMenu[30] ={0};
mfwic 3:d8948c5b2951 255
mfwic 3:d8948c5b2951 256 switch(menuType)
mfwic 3:d8948c5b2951 257 {
mfwic 3:d8948c5b2951 258 case MENU_DCM1: strcpy(strMenu,"DCM1"); break;
mfwic 3:d8948c5b2951 259 case MENU_CALIBRATE: strcpy(strMenu,"CAL"); break;
mfwic 3:d8948c5b2951 260 case MENU_TEST: strcpy(strMenu,"TEST"); break;
mfwic 3:d8948c5b2951 261 case MENU_MAIN: strcpy(strMenu,"MAIN"); break;
mfwic 3:d8948c5b2951 262 default: strcpy(strMenu,"UNDF"); break;
mfwic 3:d8948c5b2951 263 }
mfwic 3:d8948c5b2951 264
mfwic 3:d8948c5b2951 265 // append the CR,LF and the ready character
mfwic 3:d8948c5b2951 266 if(serialStatus.computer)
mfwic 3:d8948c5b2951 267 {
mfwic 3:d8948c5b2951 268 sendSerial("\r");
mfwic 3:d8948c5b2951 269 }
mfwic 3:d8948c5b2951 270 else
mfwic 3:d8948c5b2951 271 {
mfwic 3:d8948c5b2951 272 // adds a carrot so you know you are talking in terminal
mfwic 3:d8948c5b2951 273 sprintf(strbuf,"\n\r%s>",strMenu);
mfwic 3:d8948c5b2951 274 sendSerial(strbuf);
mfwic 3:d8948c5b2951 275 // sendSerial("\n\r>");
mfwic 3:d8948c5b2951 276 }
mfwic 8:d3d7dca419b3 277 }
mfwic 8:d3d7dca419b3 278
mfwic 16:5791665200cb 279 void menu_banner(void)
mfwic 8:d3d7dca419b3 280 {
mfwic 8:d3d7dca419b3 281 clrScrn();
mfwic 18:78e982f31c6b 282 sprintf( strbuf, "%c[30m", 27 ); // ESC=27, Black Text
mfwic 18:78e982f31c6b 283 sendSerial(strbuf);
mfwic 8:d3d7dca419b3 284 sprintf(strbuf," ___ _ ___ __ ____ _____ __ \r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 285 sprintf(strbuf," / | ____ _(_) (_) /___ __ / __ \\____ _ _____ _____ / ___/__ _______/ /____ ____ ___ _____\r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 286 sprintf(strbuf," / /| |/ __ `/ / / / __/ / / / / /_/ / __ \\ | /| / / _ \\/ ___/ \\__ \\/ / / / ___/ __/ _ \\/ __ `__ \\/ ___/\r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 287 sprintf(strbuf," / ___ / /_/ / / / / /_/ /_/ / / ____/ /_/ / |/ |/ / __/ / ___/ / /_/ (__ ) /_/ __/ / / / / (__ ) \r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 288 sprintf(strbuf,"/_/ |_\\__, /_/_/_/\\__/\\__, / /_/ \\____/|__/|__/\\___/_/ /____/\\__, /____/\\__/\\___/_/ /_/ /_/____/ \r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 289 sprintf(strbuf," /____/ /____/ /____/ \r\n");sendSerial(strbuf);
mfwic 8:d3d7dca419b3 290 }
mfwic 8:d3d7dca419b3 291 /*
mfwic 8:d3d7dca419b3 292 sprintf(strbuf," ___ _ ___ __ ____ _____ __ \r\n");
mfwic 8:d3d7dca419b3 293 sprintf(strbuf," / | ____ _(_) (_) /___ __ / __ \____ _ _____ _____ / ___/__ _______/ /____ ____ ___ _____\r\n");
mfwic 8:d3d7dca419b3 294 sprintf(strbuf," / /| |/ __ `/ / / / __/ / / / / /_/ / __ \ | /| / / _ \/ ___/ \__ \/ / / / ___/ __/ _ \/ __ `__ \/ ___/\r\n");
mfwic 8:d3d7dca419b3 295 sprintf(strbuf," / ___ / /_/ / / / / /_/ /_/ / / ____/ /_/ / |/ |/ / __/ / ___/ / /_/ (__ ) /_/ __/ / / / / (__ ) \r\n");
mfwic 8:d3d7dca419b3 296 sprintf(strbuf,"/_/ |_\__, /_/_/_/\__/\__, / /_/ \____/|__/|__/\___/_/ /____/\__, /____/\__/\___/_/ /_/ /_/____/ \r\n");
mfwic 8:d3d7dca419b3 297 sprintf(strbuf," /____/ /____/ /____/ \r\n");
mfwic 8:d3d7dca419b3 298 */