diff --git a/Core/Inc/my.h b/Core/Inc/my.h index a11513c..5c6f31b 100644 --- a/Core/Inc/my.h +++ b/Core/Inc/my.h @@ -83,10 +83,14 @@ typedef enum // }callibrationMenuState; -typedef enum{ //перечисления для единиц измерения - MS2=0, - PA, - H +typedef enum{Accel = 0, + Velocity, + Pascal, + k_Pascal, + M_Pascal, + Nython, + k_Nuthon, + mV, } unit; int asciiToFloat4(uint16_t str[]); //todo: заправить функции не использующиеся вне diff --git a/Core/Src/flash.c b/Core/Src/flash.c index dec4bf0..56c5458 100644 --- a/Core/Src/flash.c +++ b/Core/Src/flash.c @@ -148,7 +148,7 @@ volatile bool rewrite = false; currentData.KCOND = 1.0f; currentData.SENS = 1.0f; - currentData.UNIT =MS2; + currentData.UNIT =Accel; rewrite = true; } diff --git a/Core/Src/keys.c b/Core/Src/keys.c index 23d0705..dc1a161 100644 --- a/Core/Src/keys.c +++ b/Core/Src/keys.c @@ -146,8 +146,8 @@ void keysHandler(void){ break; case UNITSELECT: - if((key==UP_BTN_Pin)&&(currentData.UNITMS2)) {currentData.UNIT--; sh_applysetting(¤tData);} + if((key==UP_BTN_Pin)&&(currentData.UNITAccel)) {currentData.UNIT--; sh_applysetting(¤tData);} break; case OUT: diff --git a/Core/Src/modbus.c b/Core/Src/modbus.c index 6878bcc..c194a23 100644 --- a/Core/Src/modbus.c +++ b/Core/Src/modbus.c @@ -408,7 +408,7 @@ void Receive_Complete(void){ //СЏ сейчас РїРѕРїСЂРѕР±СѓСЋ раскоме *(pch + (j ^ 1)) = iobuf[j + 7]; if((recivedData.IIN > 0) || (recivedData.IKU > Ku1000) || (recivedData.IFV > Hp10) - || (recivedData.IFN > Lp100000) || (recivedData.UNIT > H) || (recivedData.IPZ > 1)|| (recivedData.OVERLOAD > 1)) + || (recivedData.IFN > Lp100000) || (recivedData.UNIT > mV) || (recivedData.IPZ > 1)|| (recivedData.OVERLOAD > 1)) { tx[0] = iobuf[0]; tx[1] = (iobuf[1] | 0x80); diff --git a/Core/Src/screen.c b/Core/Src/screen.c index f37d9b5..ad388d9 100644 --- a/Core/Src/screen.c +++ b/Core/Src/screen.c @@ -14,7 +14,7 @@ extern uint8_t iobuf[256]; -const char STRING_DATCHIK[] = "Lfnxbr"; +const char STRING_DATCHIK[] = "D[jl"; const char STRING_PKL[] = "gRk/"; const char STRING_VIHOD[] = "Ds[jl"; @@ -44,14 +44,7 @@ const char STRING_Ku200[] = "200"; const char STRING_Ku500[] = "500"; const char STRING_Ku1000[] = "1000"; - - -const char *STRINGS_UNITS[]={"vc2","Gf","Y&"}; - - - - - +const char *STRINGS_UNITS[]={"v/c2","vv/c","Gf","rGf","VGf","Y","rY","vD"}; const char *STRINGS_OUTUNITS[] = {"0~0001vD/", @@ -237,30 +230,30 @@ void screenDraw(void) FontSet(Segoe_UI_Rus_10); OLED_DrawStr(STRING_DATCHIK, 1, 10, TEXT); - if(menuPointer==KPR0) DrawSome(currentData.IK0, 40, 10, CURSOR); - else DrawSome(currentData.IK0, 40, 10, TEXT); + if(menuPointer==KPR0) DrawSome(currentData.IK0, 30, 10, CURSOR); + else DrawSome(currentData.IK0, 30, 10, TEXT); - if(menuPointer==KPR1) DrawSome(currentData.IK1, 47, 10, CURSOR); - else DrawSome(currentData.IK1, 47, 10, TEXT); + if(menuPointer==KPR1) DrawSome(currentData.IK1, 37, 10, CURSOR); + else DrawSome(currentData.IK1, 37, 10, TEXT); - if(menuPointer==KPR2) DrawSome(currentData.IK2, 54, 10, CURSOR); - else DrawSome(currentData.IK2, 54, 10, TEXT); + if(menuPointer==KPR2) DrawSome(currentData.IK2, 44, 10, CURSOR); + else DrawSome(currentData.IK2, 44, 10, TEXT); - if(menuPointer==KPR3) DrawSome(currentData.IK3, 61, 10, CURSOR); - else DrawSome(currentData.IK3, 61, 10, TEXT); + if(menuPointer==KPR3) DrawSome(currentData.IK3, 51, 10, CURSOR); + else DrawSome(currentData.IK3, 51, 10, TEXT); - if(menuPointer==KPR4) DrawSome(currentData.IK4, 68, 10, CURSOR); - else DrawSome(currentData.IK4, 68, 10, TEXT); + if(menuPointer==KPR4) DrawSome(currentData.IK4, 58, 10, CURSOR); + else DrawSome(currentData.IK4, 58, 10, TEXT); - if(menuPointer==KPR5) DrawSome(currentData.IK5, 75, 10, CURSOR); - else DrawSome(currentData.IK5, 75, 10, TEXT); + if(menuPointer==KPR5) DrawSome(currentData.IK5, 65, 10, CURSOR); + else DrawSome(currentData.IK5, 65, 10, TEXT); if(menuPointer==UNITSELECT){ - OLED_DrawStr(STRING_PKL, 85, 10, CURSOR); - OLED_DrawStr(STRINGS_UNITS[currentData.UNIT], 109, 10, CURSOR); + OLED_DrawStr(STRING_PKL, 75, 10, CURSOR); + OLED_DrawStr(STRINGS_UNITS[currentData.UNIT], 99, 10, CURSOR); } else { - OLED_DrawStr(STRING_PKL, 85, 10, TEXT); - OLED_DrawStr(STRINGS_UNITS[currentData.UNIT], 109, 10, TEXT); + OLED_DrawStr(STRING_PKL, 75, 10, TEXT); + OLED_DrawStr(STRINGS_UNITS[currentData.UNIT], 99, 10, TEXT); } ////////////////////////////