uses pushing box to publish to google spreadsheets with a state machine instead of a while loop

Dependents:   DCS_FINAL_CODE

Fork of GSM_PUSHING_BOX_STATE_MACHINE by DCS_TEAM

Revision:
7:6c0b6ab3cafe
Parent:
6:3ccc86304c2c
Child:
12:f3ccc43c4d3c
--- a/GSMLibrary.cpp	Thu Mar 05 21:50:30 2015 +0000
+++ b/GSMLibrary.cpp	Thu Mar 05 23:12:09 2015 +0000
@@ -78,21 +78,27 @@
             break;
             
         case GSM_AT_CSQ:
+            pc.printf("gsm_csq state\r\n");//&debug
             gsm_current_state = GSM_AT_CREG;
             break;
         case GSM_AT_CREG:
+            pc.printf("gsm_creg state\r\n");//&debug
             gsm_current_state = GSM_AT_CMGF;
             break;
         case GSM_AT_CMGF:
+        pc.printf("gsm_cmgf state\r\n");//&debug
             gsm_current_state = GSM_AT_CMGS;
             break;
         case GSM_AT_CMGS:
+        pc.printf("gsm_cmgs state\r\n");//&debug
             gsm_current_state = GSM_AT_SENDSMS;
             break;
         case GSM_AT_SENDSMS:
+        pc.printf("gsm_send_sms state\r\n");//&debug
             gsm_current_state = GSM_SUCCESS;
             break;
         case GSM_SUCCESS:
+            pc.printf("gsm_success state\r\n");//&debug
             gsm_current_state = GSM_INITIALIZE;
             break;
         default:
@@ -100,15 +106,18 @@
     }
     
 }
-
+//set send falg on
+void gsm_send_sms(){
+    send = 1;
+}
 //
 void gsm_reset();
 
 
 //
 void gsm_initialize(){    
-     SIM_SCGC6 |= SIM_SCGC6_DMAMUX_MASK;
-      SIM_SCGC7 |= SIM_SCGC7_DMA_MASK;  
+      SIM_SCGC6 |= SIM_SCGC6_DMAMUX_MASK; //enabling dmamux clock
+      //SIM_SCGC7 |= SIM_SCGC7_DMA_MASK;  // enebaling dma clock
       pc.printf("initializing tregisters...!\r\n");
      // control register mux, enabling uart3 receive        
      DMAMUX_CHCFG0 |= DMAMUX_CHCFG_ENBL_MASK|DMAMUX_CHCFG_SOURCE(8); 
@@ -151,6 +160,7 @@
     UART_C5_REG(UART3) |= UART_C5_RDMAS_MASK | UART_C5_ILDMAS_MASK | UART_C5_LBKDDMAS_MASK;
     //activate p fifo   
     UART_PFIFO_REG(UART3) |= UART_PFIFO_RXFE_MASK; //RXFE and buffer size of 1 word
+    queueInit();
     pc.printf("Initialization done...\n\r");
 }