2018-12-21 3
Dependents: mbed-os-rest-api-V1-2 mbed-os-rest-api-V1-2-2
Diff: DataStorage.cpp
- Revision:
- 0:833da29046f9
- Child:
- 1:3b10241770d7
diff -r 000000000000 -r 833da29046f9 DataStorage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DataStorage.cpp Fri Dec 21 07:54:17 2018 +0000 @@ -0,0 +1,85 @@ +#include "module_for_all.h" + +bool DataStorage::isAccept = false; +int DataStorage::noAcceptCount = 0; + +int DataStorage::ipSelect = 1; +char* DataStorage::ipChar = 0; +std::string DataStorage::ipStr = ""; + +std::string DataStorage::http_method = ""; +std::string DataStorage::api_command = ""; +std::string DataStorage::response = ""; + +int DataStorage::WM_PWM[5][2] = {{0,0}, {0,0}, {0,0}, {0,0}, {0,0}}; + +DigitalOut DataStorage::_W1_A(PC_6); +//DigitalOut DataStorage::_W1_B(PD_8); +//DigitalOut DataStorage::_W1_A(PA_8); +DigitalOut DataStorage::_W1_B(PB_10); +//DigitalIn DataStorage::_W1_Ai(PC_6); +//DigitalIn DataStorage::_W1_Bi(PD_8); + +DigitalOut DataStorage::_W2_A(PA_12); +DigitalOut DataStorage::_W2_B(PA_11); +DigitalOut DataStorage::_W3_A(PB_12); +DigitalOut DataStorage::_W3_B(PB_11); +DigitalOut DataStorage::_W4_A(PB_2); +DigitalOut DataStorage::_W4_B(PB_15); + +PwmOut DataStorage::_WM_PWM_out01(PD_14); +PwmOut DataStorage::_WM_PWM_out02(PD_15); +PwmOut DataStorage::_WM_PWM_out03(PE_12); +PwmOut DataStorage::_WM_PWM_out04(PE_14); + +/*PwmOut WM_PWM_out01 = new WM_PWM_out01(PD_14); +PwmOut WM_PWM_out02 = new WM_PWM_out02(PD_15); +PwmOut WM_PWM_out03 = new WM_PWM_out03(PE_12); +PwmOut WM_PWM_out04 = new WM_PWM_out04(PE_14);*/ + +DigitalOut* DataStorage::WM_Control_out[4][2] = { + {&DataStorage::_W1_A, &DataStorage::_W1_B}, + {&DataStorage::_W2_A, &DataStorage::_W2_B}, + {&DataStorage::_W3_A, &DataStorage::_W3_B}, + {&DataStorage::_W4_A, &DataStorage::_W4_B}}; + +PwmOut* DataStorage::WM_PWM_out[4] = { + &DataStorage::_WM_PWM_out01, + &DataStorage::_WM_PWM_out02, + &DataStorage::_WM_PWM_out03, + &DataStorage::_WM_PWM_out04}; + +DataStorage::DataStorage() { + //testInt1 = 111; + //testInt2 = 222; + //testInt3 = 333; +} + +DataStorage::DataStorage(std::string tmpTest) { + //testInt1 = 111; + //testInt2 = 222; + //testInt3 = 333; +} + +/*void DataStorage::setConfig_PWM(PwmOut** tmpPwmOut, int tmpPwm[5][2]) { + //printf("### DS - 01 - 00 - %d\r\n", testInt1); + //WM_PWM = tmpPwm; + //WM_PWM_out = tmpPwmOut; + + printf("### DS - 01 - 01 - %d\r\n", WM_PWM[0][0]); + printf("### DS - 01 - 02 - %d\r\n", WM_PWM[0][1]); + printf("### DS - 01 - 03 - %d\r\n", WM_PWM[1][0]); + printf("### DS - 01 - 04 - %d\r\n", WM_PWM[1][1]); + printf("### DS - 01 - 05 - %d\r\n", WM_PWM[2][1]); + + wait(0.5); + + printf("### DS - 01 - 06\r\n"); +} + +int DataStorage::get_testInt1(){ + //printf("### DS - 02 - 01 - %d\r\n", testInt1); + printf("### DS - 02 - 02 - %d\r\n", WM_PWM[0][0]); + int tmp = WM_PWM[0][0]; + return tmp; +}*/ \ No newline at end of file