Skip to content

Commit

Permalink
ver 2.21.11.3010
Browse files Browse the repository at this point in the history
Last version firmware, added Pulse configuration
  • Loading branch information
Jarins committed Nov 29, 2021
1 parent 6bfb09f commit b4c936d
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 130 deletions.
11 changes: 10 additions & 1 deletion Software/CubeMX/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
</option>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.verbose.1715505664" name="Verbose (-v)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags.199921521" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.otherflags" useByScannerDiscovery="true" valueType="stringList"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.811083826" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1359136415" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
Expand All @@ -154,6 +155,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1391397879" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" useByScannerDiscovery="false" value="${workspace_loc:/${ProjName}/STM32F103C8TX_FLASH.ld}" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.verbose.1240650343" name="Verbose (-Wl,--verbose)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.cref.1070556615" name="Add symbol cross reference table to map file (-Wl,--cref)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.cref" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.otherflags.1608800563" name="Other flags" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.otherflags" useByScannerDiscovery="false" valueType="stringList"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.955430234" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
Expand Down Expand Up @@ -196,7 +198,14 @@
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/SPD_DC_Motor"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/SPD_DC_Motor"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>
2 changes: 1 addition & 1 deletion Software/CubeMX/Application/ButtonBeep.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
static BtnState BtnPUSH = {false,But_None,BPUSH_GPIO_Port, BPUSH_Pin};
static BtnState BtnPULL = {false,But_None,BPULL_GPIO_Port, BPULL_Pin};
static BtnState BtnCFG = {false,But_None,BCFG_GPIO_Port, BCFG_Pin};
BtnState* ButList[] = {&BtnPUSH, &BtnPULL, &BtnCFG};
volatile BtnState* ButList[] = {&BtnPUSH, &BtnPULL, &BtnCFG};

static uint8_t BuzzerActive = 0;

Expand Down
2 changes: 1 addition & 1 deletion Software/CubeMX/Application/ButtonBeep.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef enum{
bbb_ToneTd_VeryHigh = 4
}bbb_ToneTd;

extern BtnState* ButList[CountButtons];
extern volatile BtnState* ButList[CountButtons];

extern void bbb_Beep(uint8_t tone, uint8_t time);
extern void bbb_Melody2(uint8_t tone1, uint8_t tone2, uint16_t time);
Expand Down
45 changes: 31 additions & 14 deletions Software/CubeMX/Application/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,47 @@
//INIT SCREEN INFO --- 18 char per line max
#define DEVSTRING "DCMotor dispenser"
#define NAMESTRING " By Jarin (c)2021"
#define REVSTR " v2.0"
#define REVSTR " v2.21.11.3010"

#define TMPSIZE 21 //18 is the length of line
char Tmp[TMPSIZE];
char Line[TMPSIZE];
char floatBuf[10]; //temp buffer for float conversion
char PulseText[6];
char DurationText[6];
char SpeedText[6];

char* disp_PulseDesc(int16_t pulse)
{
if(pulse>0)
{
floatToString(floatBuf, (float)((pulse*100)/1000.0), 1, 2, 1);
strcpy(PulseText,floatBuf);
strcat(PulseText,"s");
}
else strcpy(PulseText,"Dis ");

return PulseText;
}
char* disp_RetractDurationDesc(int16_t Duration)
{
if(Duration>0)
{
floatToString(floatBuf, (float)((Duration*100)/1000.0), 1, 3 );
floatToString(floatBuf, (float)((Duration*100)/1000.0), 1, 3, 0);
strcpy(DurationText,floatBuf);
strcat(DurationText,"s");
}
else strcpy(DurationText,"Dis ");

return DurationText;
}

char* disp_SpeedDesc(int16_t Speed)
{
itoa(Speed*5,SpeedText,10);
strcat(SpeedText,"%");
return SpeedText;
}


/*
* Draws frame around specified area (optionally filled with black color)
*/
Expand All @@ -63,7 +74,6 @@ void disp_DrawFrame(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t isFi
}
}


/*
* Draws "saved" pop-up window in the center of the screen
*/
Expand All @@ -77,7 +87,6 @@ void disp_DrawSavedPopup(void){
SSD1306_UpdateScreen();
}


/*
* Draws loading screen with battery voltage and core temperature
*/
Expand All @@ -101,33 +110,37 @@ void disp_DrawInitScreen(void){
* Draws normal screen, cfg mode specifies which configuration is highlighted, pushspeed, pullduration is string representation of selected parameters
*/
void disp_DrawScreen(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, float vBat, float iMeas, float tCore){
void disp_DrawScreen(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, char* pushPulse, float vBat, float iMeas, float tCore){

SSD1306_Fill(SSD1306_COLOR_BLACK);
//disp_DrawFrame(0, 0, 127, Start_Y+31, 0);

//FIRST LINE
strcpy(Line," Speed: ");
strcpy(Line," Speed ");
strcat(Line,pushSpeed);
SSD1306_GotoXY(1, Start_Y+0);
SSD1306_Puts(Line, &Font_7x10, SSD1306_COLOR_WHITE);

//SECOND LINE
strcpy(Line," Retract: ");
strcpy(Line," Retr ");
strcat(Line,pullDur);
strcat(Line," Puls");
strcat(Line,pushPulse);
SSD1306_GotoXY(1, Start_Y+10);
SSD1306_Puts(Line, &Font_7x10, SSD1306_COLOR_WHITE);

//THIRD LINE - button functions
if(cfgMode>0){
strcpy(Line," OK Less More");
strcpy(Line," Pulse ");
strcat(Line,pushPulse);
//strcpy(Line," OK Less More");
}
else{
strcpy(Line,"Bat: ");
floatToString(floatBuf, vBat, 1, 3 );
strcpy(Line,"Bat ");
floatToString(floatBuf, vBat, 1, 3, 0 );
strcat(Line,floatBuf);
strcat(Line,"V t:");
floatToString(floatBuf, tCore, 1, 3 );
strcat(Line,"V CPU");
floatToString(floatBuf, tCore, 1, 3, 0 );
strcat(Line,floatBuf);
strcat(Line,"^C"); // file font.c is upgrade to Degrees symbol on the 94(0x5E '^') char position
}
Expand All @@ -144,6 +157,10 @@ void disp_DrawScreen(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, flo
SSD1306_GotoXY(0, Start_Y+10);
SSD1306_Putc('o', &Font_7x10, SSD1306_COLOR_WHITE);
}
else if(cfgMode == disp_CfgModeTd_Pulse){
SSD1306_GotoXY(0, Start_Y+21);
SSD1306_Putc('o', &Font_7x10, SSD1306_COLOR_WHITE);
}

SSD1306_UpdateScreen();
}
Expand Down
4 changes: 3 additions & 1 deletion Software/CubeMX/Application/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ typedef enum{
disp_CfgModeTd_None = 0,
disp_CfgModeTd_Speed = 1,
disp_CfgModeTd_Ret = 2,
disp_CfgModeTd_Pulse = 3,
}disp_CfgModeTd;

extern char* disp_PulseDesc(int16_t pulse);
extern char* disp_RetractDurationDesc(int16_t Duration);
extern char* disp_SpeedDesc(int16_t Speed);
extern void disp_DrawSavedPopup(void);
extern void disp_DrawInitScreen(void);
extern void disp_DrawScreen(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, float vBat, float iMeas, float tCore);
extern void disp_DrawScreen(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, char* pushPulse, float vBat, float iMeas, float tCore);
//extern void disp_DrawScreenDate(disp_CfgModeTd cfgMode, char* pushSpeed, char* pullDur, RTC_DateTypeDef *rtcDate);


Expand Down
Loading

0 comments on commit b4c936d

Please sign in to comment.