Telliskivi 2 2014

Dependencies:   DoubleCoilGun 4DGL-uLCD-SE ExternalIn HumanInterfaceT14 LedOut MCP3021 MODSERIAL Motor1Pwm1Dir PCA9555 PinDetect QED RgbLedPCA9555 WDT_K64F mbed-src

Fork of Telliskivi2plus by Reiko Randoja

Files at this revision

API Documentation at this revision

Comitter:
Reiko
Date:
Sun Nov 23 02:29:08 2014 +0000
Parent:
10:28a3a5571842
Commit message:
Serial buffer changes

Changed in this revision

HumanInterfaceT14.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/HumanInterfaceT14.lib	Fri Nov 21 18:32:08 2014 +0000
+++ b/HumanInterfaceT14.lib	Sun Nov 23 02:29:08 2014 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/Reiko/code/HumanInterfaceT14/#0a82202bc5df
+http://developer.mbed.org/users/Reiko/code/HumanInterfaceT14/#64a46d67cb6e
--- a/main.cpp	Fri Nov 21 18:32:08 2014 +0000
+++ b/main.cpp	Sun Nov 23 02:29:08 2014 +0000
@@ -22,7 +22,7 @@
 
 #define SERVER_PORT   8042
 
-//Watchdog watchdog;
+Watchdog watchdog;
 
 Ticker sensorUpdate;
 Ticker imuUpdate;
@@ -33,7 +33,7 @@
 DigitalOut led4(LED_BLUE);
 
 //Serial pc(USBTX, USBRX); // tx, rx
-MODSERIAL pc(USBTX, USBRX, 8192, 8192); 
+MODSERIAL pc(USBTX, USBRX, 512, 512); 
 //ADXL345_I2C accelerometer(p9, p10);
 //L3G4200D gyro(p9, p10);
 //HMC5883L compass(p9, p10);
@@ -150,7 +150,7 @@
 char sendBuffer[256];
 int charCounter = 0;
 
-char serialBuffer[8192];
+char serialBuffer[512];
 
 // This function is called when a character goes from the TX buffer
 // to the Uart THR FIFO register.
@@ -507,7 +507,7 @@
     int serialReadUnblockCount = 0;
     int serialReadUnblockLimit = 40;
     
-    //watchdog.kick(3);
+    watchdog.kick(3);
     
     while (1) {
         
@@ -579,8 +579,8 @@
                     motor5.setSpeed(0);
                     //dribbler.pulsewidth_us(0);     
                     
-                    pc.rxBufferFlush();
-                    pc.txBufferFlush();                
+                    //pc.rxBufferFlush();
+                    //pc.txBufferFlush();                
                 }                
             }
             
@@ -615,7 +615,7 @@
             
             //led1 = !led1;
             
-            t.stop();
+            /*t.stop();
             float dt = t.read();
             t.reset();
             t.start();
@@ -630,7 +630,7 @@
             
             if (dtMax >= 0.02f) {
                 printf("<dtmax=%.5f>\n", dtMax);
-            }            
+            }*/
             
             isMainUpdate = true;
         }
@@ -672,7 +672,7 @@
                 motor5.getStallLevel());
             server.sendTo(client, sendBuffer, charCount);*/
             pc.printf(
-                "<stall:%d:%d:%d:%d:%d>", 
+                "<stall:%d:%d:%d:%d:%d>\n", 
                 motor1.getStallLevel(),
                 motor2.getStallLevel(),
                 motor3.getStallLevel(),