Forgot to explicitly init silent=0.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 7 May 2012 22:46:37 +0000 (22:46 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 7 May 2012 22:46:37 +0000 (22:46 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1168 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/apps/monitor/monitor.c
firmware/goodfet.c
firmware/lib/command.c
firmware/lib/stm32f407.c

index 039cf6e..4f36833 100644 (file)
@@ -51,8 +51,8 @@ app_t const monitor_app = {
 
 //! Handles a monitor command.
 void monitor_handle_fn(uint8_t const app,
 
 //! Handles a monitor command.
 void monitor_handle_fn(uint8_t const app,
-                                          uint8_t const verb,
-                                          uint32_t const len)
+                      uint8_t const verb,
+                      uint32_t const len)
 {
        int i;
 
 {
        int i;
 
@@ -63,9 +63,10 @@ void monitor_handle_fn(uint8_t const app,
                break;
 
        case MONITOR_ECHO:
                break;
 
        case MONITOR_ECHO:
-               //Echo back the same buffer.
-               txdata(app,verb,len);
-               break;
+         //Echo back the same buffer.
+         debugstr("About to monitor echo.");
+         txdata(app,verb,len);
+         break;
 
        case MONITOR_LIST_APPS:
                // transmit firmware build date
 
        case MONITOR_LIST_APPS:
                // transmit firmware build date
@@ -87,6 +88,8 @@ void monitor_handle_fn(uint8_t const app,
                cmddata[0]=memorybyte[cmddataword[0]];
           #else
                debugstr("Monitor peeks are unsupported on this platform.");
                cmddata[0]=memorybyte[cmddataword[0]];
           #else
                debugstr("Monitor peeks are unsupported on this platform.");
+               debughex(cmddataword[0]);
+               cmddata[0]=0x00;
          #endif
                txdata(app,verb,1);
                break;
          #endif
                txdata(app,verb,1);
                break;
@@ -98,6 +101,8 @@ void monitor_handle_fn(uint8_t const app,
                cmddata[0] = memorybyte[cmddataword[0]];
           #else
                debugstr("Monitor pokes are unsupported on this platform.");
                cmddata[0] = memorybyte[cmddataword[0]];
           #else
                debugstr("Monitor pokes are unsupported on this platform.");
+               debughex(cmddataword[0]);
+               cmddata[0]=0x00;
          #endif
                txdata(app,verb,1);
                break;
          #endif
                txdata(app,verb,1);
                break;
index 90e4d0f..939c52c 100644 (file)
@@ -84,6 +84,9 @@ int main(void){
   unsigned long len;
   // MSP reboot count for reset input & reboot function located at 0xFFFE
   volatile unsigned int reset_count = 0;
   unsigned long len;
   // MSP reboot count for reset input & reboot function located at 0xFFFE
   volatile unsigned int reset_count = 0;
+  
+  silent=0; //Don't trust globals.
+  
 #if (platform == tilaunchpad)
   int ret=0;
   
 #if (platform == tilaunchpad)
   int ret=0;
   
index 7c57798..6388c64 100644 (file)
@@ -66,7 +66,7 @@ void txhead(unsigned char app,
 void txdata(unsigned char app,
            unsigned char verb,
            unsigned long len){
 void txdata(unsigned char app,
            unsigned char verb,
            unsigned long len){
-  unsigned int i=0;
+  unsigned long i=0;
   if(silent)
     return;
   txhead(app,verb,len);
   if(silent)
     return;
   txhead(app,verb,len);
@@ -148,7 +148,7 @@ void prep_timer()
   TBCTL = 0x0204; /* Driven by SMCLK; disable Timer B interrupts;
                     reset timer in case it was previously in use */
   #else
   TBCTL = 0x0204; /* Driven by SMCLK; disable Timer B interrupts;
                     reset timer in case it was previously in use */
   #else
-  #warning "Function unimplemented for this platform."
+  #warning "prep_timer() unimplemented for this platform."
   #endif
 }
 #if (platform != tilaunchpad)
   #endif
 }
 #if (platform != tilaunchpad)
index fd06abc..577fec0 100644 (file)
@@ -140,7 +140,9 @@ void USART1_Configuration(void)
   //USART_InitStructure.USART_BaudRate = 115200;
   //USART_InitStructure.USART_BaudRate = 125200;  //Close enough to 115200
   
   //USART_InitStructure.USART_BaudRate = 115200;
   //USART_InitStructure.USART_BaudRate = 125200;  //Close enough to 115200
   
-  USART_InitStructure.USART_BaudRate = 130000;  //Close enough to 115200
+  //135000 is too high
+  //115200 is too low
+  USART_InitStructure.USART_BaudRate = 125000;  //Close enough to 115200
   
   USART_InitStructure.USART_WordLength = USART_WordLength_8b;
   USART_InitStructure.USART_StopBits = USART_StopBits_1;
   
   USART_InitStructure.USART_WordLength = USART_WordLength_8b;
   USART_InitStructure.USART_StopBits = USART_StopBits_1;