main: display blank values

This commit is contained in:
Vasily Davydov
2022-10-16 12:46:36 +03:00
parent 243766044c
commit dd00c13714
8 changed files with 166 additions and 28 deletions

View File

@@ -45,6 +45,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<option id="com.crt.advproject.cpp.misc.dialect.1893636131" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
<inputType id="com.crt.advproject.compiler.cpp.input.1024506123" superClass="com.crt.advproject.compiler.cpp.input"/>
@@ -73,6 +74,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<option id="com.crt.advproject.c.misc.dialect.1885316467" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
<inputType id="com.crt.advproject.compiler.input.1491212950" superClass="com.crt.advproject.compiler.input"/>
@@ -91,6 +93,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.486566022" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="com.crt.advproject.assembler.input.255980151" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
@@ -122,6 +125,7 @@
<listOptionValue builtIn="false" value="LiquidCrystal"/>
<listOptionValue builtIn="false" value="I2C"/>
<listOptionValue builtIn="false" value="StateHandler"/>
<listOptionValue builtIn="false" value="Timer"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.paths.804461696" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/Debug}&quot;"/>
@@ -130,6 +134,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/Debug}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/Debug}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/Debug}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/Debug}&quot;"/>
</option>
<option id="com.crt.advproject.link.cpp.crpenable.8641361" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.cpp.crpenable"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.849613399" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
@@ -194,6 +199,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<option id="com.crt.advproject.cpp.misc.dialect.1640449237" name="Language standard" superClass="com.crt.advproject.cpp.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
<inputType id="com.crt.advproject.compiler.cpp.input.812988440" superClass="com.crt.advproject.compiler.cpp.input"/>
@@ -222,6 +228,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<option id="com.crt.advproject.c.misc.dialect.1383624929" name="Language standard" superClass="com.crt.advproject.c.misc.dialect" useByScannerDiscovery="true" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
<inputType id="com.crt.advproject.compiler.input.391538574" superClass="com.crt.advproject.compiler.input"/>
@@ -240,6 +247,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/inc}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1169670567" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="com.crt.advproject.assembler.input.956763731" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
@@ -271,6 +279,7 @@
<listOptionValue builtIn="false" value="LiquidCrystal"/>
<listOptionValue builtIn="false" value="I2C"/>
<listOptionValue builtIn="false" value="StateHandler"/>
<listOptionValue builtIn="false" value="Timer"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.paths.245096214" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/Release}&quot;"/>
@@ -279,6 +288,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/LiquidCrystal/Release}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/I2C/Release}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/StateHandler/Release}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Timer/Release}&quot;"/>
</option>
<option id="com.crt.advproject.link.cpp.crpenable.209534913" name="Enable automatic placement of Code Read Protection field in image" superClass="com.crt.advproject.link.cpp.crpenable"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1513506142" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">

View File

@@ -9,6 +9,7 @@
<project>LiquidCrystal</project>
<project>I2C</project>
<project>StateHandler</project>
<project>Timer</project>
</projects>
<buildSpec>
<buildCommand>

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.crt.dsfdebug.crtmcu.launchType">
<stringAttribute key=".gdbinit" value=""/>
<booleanAttribute key="attach" value="false"/>
<stringAttribute key="bootrom.stall" value=""/>
<stringAttribute key="com.crt.ctrlcenter.OFSemuDetails" value="LinkServer"/>
<booleanAttribute key="com.crt.ctrlcenter.crtInit" value="true"/>
<stringAttribute key="com.crt.ctrlcenter.currentWireType" value="SWD"/>
<booleanAttribute key="com.crt.ctrlcenter.mainBreakIsHardware" value="true"/>
<stringAttribute key="com.crt.ctrlcenter.serialNumber" value="LinkServerNXP SemiconductorsLPC-LINK2 CMSIS-DAP V5.361OSAVCQOQ"/>
<mapAttribute key="com.crt.ctrlcenter.symbolsGroupSettings"/>
<intAttribute key="com.crt.ctrlcenter.version" value="6"/>
<stringAttribute key="com.nxp.mcuxpresso.flash.base.address" value="0x0"/>
<booleanAttribute key="com.nxp.mcuxpresso.flash.clear.console" value="true"/>
<booleanAttribute key="com.nxp.mcuxpresso.flash.confirm" value="false"/>
<stringAttribute key="com.nxp.mcuxpresso.flash.erase.algorithm" value="Mass erase"/>
<stringAttribute key="com.nxp.mcuxpresso.flash.executable" value="axf"/>
<stringAttribute key="com.nxp.mcuxpresso.flash.program.action" value="Program"/>
<booleanAttribute key="com.nxp.mcuxpresso.flash.reset.target" value="true"/>
<stringAttribute key="com.nxp.mcuxpresso.ide.probe.manufacturer" value="NXP Semiconductors"/>
<stringAttribute key="com.nxp.mcuxpresso.ide.probe.name" value="LPC-LINK2 CMSIS-DAP V5.361"/>
<stringAttribute key="com.nxp.mcuxpresso.ide.probe.type" value="LinkServer"/>
<stringAttribute key="debug.level" value="2"/>
<stringAttribute key="emu.speed" value=""/>
<stringAttribute key="flash.driver.reset" value=""/>
<stringAttribute key="gdbserver.host" value="localhost"/>
<stringAttribute key="gdbserver.port" value="10989"/>
<booleanAttribute key="gdbserver.start" value="true"/>
<stringAttribute key="internal.connect.script" value="LPC15RunBootRomConnect.scp"/>
<booleanAttribute key="internal.has_swo" value="true"/>
<stringAttribute key="internal.prelaunch.command" value=""/>
<stringAttribute key="internal.reset.script" value="LPC15RunBootRomReset.scp"/>
<stringAttribute key="internal.resethandling" value=""/>
<stringAttribute key="internal.semihost" value="On"/>
<stringAttribute key="internal.wirespeed" value=""/>
<stringAttribute key="internal.wiretype" value="SWD*"/>
<stringAttribute key="launch.config.handler" value="com.crt.ctrlcenter.launch.CRTLaunchConfigHandler"/>
<booleanAttribute key="mem.access" value="false"/>
<stringAttribute key="misc.options" value=""/>
<stringAttribute key="ondisconnect" value="cont"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="0"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set non-stop on&#10;set pagination off&#10;set mi-async&#10;&#10;set remotetimeout 60000&#10;##target_extended_remote##&#10;set mem inaccessible-by-default ${mem.access}&#10;mon ondisconnect ${ondisconnect}&#10;set arm force-mode thumb&#10;${load}&#10;&#9;"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="10989"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value="&#10;${run}&#10;&#9;"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.EXTERNAL_CONSOLE" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=""/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/esp-vent-main.axf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="esp-vent-main"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.crt.advproject.config.exe.debug.1850577128"/>
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/esp-vent-main"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[debug]" value="com.nxp.mcuxpresso.core.debug.support.linkserver.launch.LinkServerGdbLaunch"/>
</mapAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;"/>
<stringAttribute key="process_factory_id" value="com.nxp.mcuxpresso.core.debug.override.MCXProcessFactory"/>
<booleanAttribute key="redlink.disable.preconnect.script" value="false"/>
<booleanAttribute key="redlink.enable.flashhashing" value="true"/>
<booleanAttribute key="redlink.enable.rangestepping" value="true"/>
<stringAttribute key="run" value="cont"/>
<booleanAttribute key="vector.catch" value="true"/>
</launchConfiguration>

View File

@@ -17,6 +17,7 @@
#endif
#include "DigitalIoPin.h"
#include "LiquidCrystal.h"
#include "StateHandler.h"
#include <cr_section_macros.h>
@@ -40,34 +41,54 @@ main (void)
Board_LED_Set (0, true);
#endif
#endif
/** Lcd & stateHandler */
Chip_RIT_Init (LPC_RITIMER);
DigitalIoPin rs (0, 29, false, true, false);
DigitalIoPin en (0, 9, false, true, false);
DigitalIoPin d4 (0, 10, false, true, false);
DigitalIoPin d5 (0, 16, false, true, false);
DigitalIoPin d6 (1, 3, false, true, false);
DigitalIoPin d7 (0, 0, false, true, false);
LiquidCrystal lcd (&rs, &en, &d4, &d5, &d6, &d7);
StateHandler ventMachine (&lcd);
//
lcd.setCursor (0, 0);
lcd.print ("Test");
DigitalIoPin b_up ();
DigitalIoPin b_down ();
DigitalIoPin b_toggle ();
bool b_up_state = false, b_down_state = false, b_toggle_state = false;
StateHandler ventMachine;
/** Common pins */
DigitalIoPin b_up (0, 7, true, true, true); // A5
bool b_up_state = false;
DigitalIoPin b_down (0, 6, true, true, true); // A4
bool b_down_state = false;
DigitalIoPin b_toggle (0, 5, true, true, true); // A3
bool b_toggle_state = false;
int16_t pressure = 1;
while (1)
{
if (b_up.read ())
b_up_state = true;
{
b_up_state = true;
}
if (!b_up.read () && b_up_state)
{
ventMachine.HandleState (Event (Event::eKey, BUTTON_CONTROL_UP));
b_up_state = false;
}
if (b_down.read ())
b_down_state = true;
{
b_down_state = true;
}
if (!b_down.read () && b_down_state)
{
ventMachine.HandleState (Event (Event::eKey, BUTTON_CONTROL_DOWN));
b_down_state = false;
}
if (b_toggle.read ())
b_toggle_state = true;
{
b_toggle_state = true;
}
if (!b_toggle.read () && b_toggle_state)
{
ventMachine.HandleState (