</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1456715682" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
+ <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1456715682" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="Get version from git" prebuildStep="echo "#define GIT_VERSION \"$(shell git describe --always)\"" > version.h">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1456715682." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain.2124995458" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.972405208">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.546456820" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.1.0.01"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rtsv7R4_T_be_v3D16_eabi.lib"/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
+ <listOptionValue builtIn="false" value="LINK_ORDER="/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.2087481517" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.9.1" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug.1287550254" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug"/>
- <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug.1748795988" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug"/>
+ <builder autoBuildTarget="all" buildPath="${BuildDirectory}" cleanBuildTarget="clean" enableAutoBuild="true" enableCleanBuild="true" enabledIncrementalBuild="true" id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug.1748795988" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GNU Make" parallelBuildOn="false" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug"/>
<tool command=""${CG_TOOL_CL}"" id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.1294730861" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.32" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.916756117" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.7R4" valueType="enumerated"/>
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/rpp/lib/rpp/include}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/rpp/lib/os/7.0.2_tms570/include}""/>
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/${ConfigName}}""/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.GCC.2008975510" name="Enable support for GCC extensions (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.GCC" value="true" valueType="boolean"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS.1617334105" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS"/>
</toolChain>
</folderInfo>
<fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1456715682.350360411" name="docgen.c" rcbsApplicability="disable" resourcePath="commands/doc/docgen.c" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449.2057512487">
-- <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449.2057512487" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449"/>
+ <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449.2057512487" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.948543449">
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS.732805611" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS.1457149119" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS.1847429483" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS"/>
+ <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS.252679747" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS"/>
+ </tool>
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.1088553770" name="Resource Custom Build Step">
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1177985543" name="Resource Custom Build Step Input Type">
<additionalInput kind="additionalinputdependency" paths=""/>
"\n"
"=== Command syntax ===\n"
"\n"
- " --> readadc\n",
+ " readadc\n",
CMD_HANDLER(cmd_do_read_adc1_values), (void *)&cmd_list_adc
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> testcan SOURCE DESTINATION\n"
+ " testcan SOURCE DESTINATION\n"
"where SOURCE and DESTINATION is a number in the range 1-3 and SOURCE\n"
"is not equal DESTINATION.\n"
"\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dacpinsetupPIN[:][VALUE] \n"
+ " dacpinsetupPIN[:][VALUE] \n"
"where\n"
"* PIN is in range 1-4\n"
"* : means set value VALUE to pin PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dacpinvalPIN[:][VALUE] \n"
+ " dacpinvalPIN[:][VALUE] \n"
"where\n"
"* PIN is in range 1-4\n"
"* : means set raw value VALUE to pin PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dacpinvoltage[:][VALUE] \n"
+ " dacpinvoltage[:][VALUE] \n"
"where\n"
"* PIN is in range 1-4\n"
"* : means set voltage VALUE to pin PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dinsetupPIN[:](A,B,C) \n"
+ " dinsetupPIN[:](A,B,C) \n"
"where\n"
"* PIN is in range 1-16\n"
"* : means setup the PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dingetPIN[:]TR \n"
+ " dingetPIN[:]TR \n"
"where\n"
"* PIN is in range 1-16\n"
"* TR is not yet implemented\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> dindiagPIN[?] \n"
+ " dindiagPIN[?] \n"
"where PIN is in range 1-16\n"
"\n"
"=== Example ===\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> ethernet\n",
+ " ethernet\n",
CMD_HANDLER(emac_test), (void *)&cmd_list_emac
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> fraystatPORT\n"
+ " fraystatPORT\n"
"where PORT is in range 1-2\n"
"\n"
"=== Example ===\n"
"in the end.\n"
"=== Command syntax ===\n"
"\n"
- " --> testfrayA\n",
+ " testfrayA\n",
CMD_HANDLER(cmd_do_test_frayA), (void *)&cmd_list_fray
};
"in the end.\n"
"=== Command syntax ===\n"
"\n"
- " --> testfrayB\n",
+ " testfrayB\n",
CMD_HANDLER(cmd_do_test_frayB), (void *)&cmd_list_fray
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> hbrenable:X\n"
+ " hbrenable:X\n"
"where X is PWM period in us\n"
"\n"
"=== Example ===\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> hbrcontrol:X\n"
+ " hbrcontrol:X\n"
"where X specifies direction and PWM duty cycle in % (thus in range -100 - 100)\n"
"\n"
"=== Example ===\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> hbrdisable\n"
+ " hbrdisable\n"
"\n"
"=== Example ===\n"
"\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> houtfail PIN\n"
+ " houtfail PIN\n"
"where PIN is in range 1-6\n"
"=== Example ===\n"
"\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> readhifbk\n",
+ " readhifbk\n",
CMD_HANDLER(cmd_do_read_hout_ifbk_values), (void *)&cmd_list_hout
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> houtpwmPIN[:|?][(PER,DUTY)]\n"
+ " houtpwmPIN[:|?][(PER,DUTY)]\n"
"where\n"
"* PIN is in range 1-6\n"
"* : means set parameters and parameters in brackets are mandatory, ? means get parameters\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> houtpwmstartPIN\n"
+ " houtpwmstartPIN\n"
"where PIN is in range 1-6\n"
"\n"
"=== Example ===\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> houtpwmstopPIN\n"
+ " houtpwmstopPIN\n"
"where PIN is in range 1-6\n"
"\n"
"=== Example ===\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> testlin\n",
+ " testlin\n",
CMD_HANDLER(cmd_do_lin_loop_back), (void *)&cmd_list_lin
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> loutsetPIN:VALUE\n"
+ " loutsetPIN:VALUE\n"
"where\n"
"* PIN is in range 1-8\n"
"* : means set VALUE on PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> loutdiagPIN?\n"
+ " loutdiagPIN?\n"
"where\n"
"* PIN is in range 1-8\n"
"* ? means get value from PIN\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> control\n",
+ " control\n",
CMD_HANDLER(cmd_do_control), (void *)&cmd_list_motor_example
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> motor\n",
+ " motor\n",
CMD_HANDLER(cmd_do_motor), (void *)&cmd_list_motor_example
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> pinlist\n",
+ " pinlist\n",
CMD_HANDLER(cmd_do_pin_list), (void *)&cmd_list_pin
};
"serves as supplement to highlevel commands for testing purpose.\n"
"=== Command syntax ===\n"
"\n"
- " --> pinvalNAME[:|?][VAL]\n"
+ " pinvalNAME[:|?][VAL]\n"
"where\n"
"* NAME is a string\n"
"* : means assign VAL to pin NAME and ? means get value from pin NAME\n"
"serves as supplement to highlevel commands for testing purpose.\n"
"=== Command syntax ===\n"
"\n"
- " --> pinvdirNAME[:|?][DIR]\n"
+ " pinvdirNAME[:|?][DIR]\n"
"where\n"
"* NAME is a string\n"
"* : means assign DIR to pin NAME and ? means get direction from pin NAME\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> portvalNAME:(VAL)\n"
+ " portvalNAME:(VAL)\n"
"where\n"
"* NAME is a string\n"
"* : means assign VAL to port NAME, ? means get value from port NAME\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> portlist\n",
+ " portlist\n",
CMD_HANDLER(cmd_do_port_list), (void *)&cmd_list_port
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> testsdram\n",
+ " testsdram\n",
CMD_HANDLER(cmd_do_test_ram), (void *)&cmd_list_sdram
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> testlog\n",
+ " testlog\n",
CMD_HANDLER(cmd_do_test_log), (void *)&cmd_list_sdram
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> spitrNAME?(CMD,RESP)\n"
+ " spitrNAME?(CMD,RESP)\n"
"where\n"
"* NAME is a string\n"
"* CMD is in range 0 - FFFFFFFF\n"
"\n"
"=== Command syntax ===\n"
" \n"
- " --> spimstSPI:ADDR([DATA])\n"
+ " spimstSPI:ADDR([DATA])\n"
"where\n"
"* SPI is in range 0 - 3\n"
"* ADDR is in range 0 - 3\n"
"\n"
"=== Command syntax ===\n"
"\n"
- " --> poweron\n",
+ " poweron\n",
CMD_HANDLER(cmd_do_power_on), (void *)&cmd_list_vbat
};
"\n"
"=== Command syntax ===\n"
"\n"
- " --> poweroff\n",
+ " poweroff\n",
CMD_HANDLER(cmd_do_power_off), (void *)&cmd_list_vbat
};
/* Include Files */\r
#include "rpp/rpp.h"\r
#include "cmdproc_freertos_tms570.h"\r
+#include "version.h" // Generated by Eclipse in the pre-build step\r
\r
/** @fn void main(void)\r
* @brief Application main function\r
void main(void)\r
{\r
rpp_init();\r
+\r
+ // Speed up the SCI\r
+ rpp_sci_setup(115200);\r
+\r
_enable_IRQ();\r
- initCmdProc(0, (uint8_t*)"\r\n----\r\n Rapid Prototyping Platform v00.02-001\r\n Porsche Engineering 06/2013\r\n----\r\n\r\nType commands", (uint8_t *)"\r\n--> ");\r
+ initCmdProc(0, (uint8_t*)"\r\n----\r\n Rapid Prototyping Platform v00.02-001\r\n SW ver " GIT_VERSION " \r\n Porsche Engineering 06/2013\r\n----\r\n\r\nType commands", (uint8_t *)"\r\n--> ");\r
vTaskStartScheduler();\r
\r
//We should never get here\r
cmd_io_puts(cmd_io," - ");
cmd_io_puts(cmd_io,help);
cmd_io_puts(cmd_io, "\r\n");
+ if (filt)
+ cmd_io_puts(cmd_io, des->long_help);
}
}
}
return SUCCESS;
}
+static int crlf_conv(uint8_t ch_in, uint8_t *ch_out)
+{
+ static bool was_cr = false;
+ if (ch_in == '\n' && !was_cr) {
+ *ch_out = '\r';
+ was_cr = true;
+ return 0; // Retry the same char next time
+ }
+ *ch_out = ch_in;
+ was_cr = (ch_in == '\r');
+ return 1; // Move to the next character
+}
+
int8_t drv_sci_send(uint32_t length, uint8_t* data, portTickType wait)
{
+ uint8_t ch;
if(sciOutBuffer.buf == NULL) {
return FAILURE;
}
}
portBASE_TYPE ret = pdTRUE;
- while(length-- > 0) {
+ while(length > 0) {
+ int ofs = crlf_conv(*data, &ch);
+ length -= ofs;
+ data += ofs;
if(!sciOutBuffer.flags & BUF_TRANSFER_IN_PROGRESS) {
taskENTER_CRITICAL();
if (!sciOutBuffer.flags & BUF_TRANSFER_IN_PROGRESS) {
sciOutBuffer.flags |= BUF_TRANSFER_IN_PROGRESS;
sciREG->SETINT = SCI_TX_INT; // Start new transfer by sending first byte
- sciREG->TD = *data++;
+ sciREG->TD = ch;
+ taskEXIT_CRITICAL();
+ continue;
}
taskEXIT_CRITICAL();
- continue;
}
- ret = xQueueSend(sciOutBuffer.buf, (void*)data++, wait);
+ ret = xQueueSend(sciOutBuffer.buf, (void*)&ch, wait);
if(ret != pdTRUE) {
xSemaphoreGive(sciOutBuffer.mutex);
return FAILURE;
}
return drv_sci_flush_buffer(&sciOutBuffer);
}
-