switch to teensy 3.0

This commit is contained in:
hg
2014-03-08 00:23:46 +01:00
parent 987be758ad
commit 89771e70d1
11 changed files with 269 additions and 207 deletions

14
cmd.cpp
View File

@ -16,7 +16,8 @@ CmdServer::CmdServer(Stream *p_stream) :
}
void CmdServer::begin() {
((Serial_*)m_stream)->begin(9600);
//((Serial*)m_stream)->begin(9600);
}
void CmdServer::exec() {
@ -24,8 +25,9 @@ void CmdServer::exec() {
bool done = false;
if (m_stream->available()) {
char ch;
while ((ch = m_stream->read()) != -1) {
int chi;
while ((chi = m_stream->read()) != -1) {
char ch = (char) chi;
switch (state) {
case 0:
if ((ch != ' ') && (ch != '\n')) {
@ -66,8 +68,8 @@ void CmdServer::registerCmd(Cmd *cmdObj) {
}
void CmdServer::parseCommand() {
//m_client.println("cmd: " + cmd);
//m_client.println("params: " + params);
//m_stream->println("cmd: " + cmd);
//m_stream->println("params: " + params);
if (cmd.equalsIgnoreCase("help")) {
for (uint8_t i = 0; i < cmdListIdx; i++) {
@ -78,7 +80,7 @@ void CmdServer::parseCommand() {
} else {
bool found = false;
for (uint8_t i = 0; i < cmdListIdx; i++) {
// m_client.println("Check: " + cmdList[i]->getCmdName());
//m_stream->println("Check: " + cmdList[i]->getCmdName());
if (cmdList[i]->getCmdName().equalsIgnoreCase(cmd)) {
found = true;
// m_client.println("cmd found");