Code written by Paul Rabbat, Angel Daruna, Jarel Hawkins, and Cordel Williams

Dependencies:   4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player

Fork of ECE4180_FinalProject by Angel Daruna

Files at this revision

API Documentation at this revision

Comitter:
prabbat3
Date:
Sun Dec 07 20:53:05 2014 +0000
Parent:
11:1c3bc07daabf
Commit message:
Code cleanup

Changed in this revision

Formatter.cpp 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/Formatter.cpp	Sun Dec 07 20:37:08 2014 +0000
+++ b/Formatter.cpp	Sun Dec 07 20:53:05 2014 +0000
@@ -5,23 +5,6 @@
 #include "alarmContainer.h"
 #include <string>
 
-/* itoa:  convert n to characters in s */
-void itoa( unsigned long long int value, char *str)
-{   
-   int i,j;
-   char temp[30];
-   for(i=0; value > 0; i++){    
-       str[i] = value%10+'0';
-       value=value/10;
-    }
-    for(j=0;i>=0;j++,i--){
-        temp[j]=str[i-1];
-    }
-    for(i=0;i<j;i++){
-        str[i]=temp[i];
-    }   
-}
-
 const char *SIMPLE_HTML_CODE = "\
 <!DOCTYPE html>\
 <html>\
@@ -82,7 +65,6 @@
 const char* INTERACTIVE_HTML_CODE_2 = "</body> \
 </html>";
 
-//static char chunk[1024];
 static char chunk[4096];
         
 Formatter::Formatter(int nb):
@@ -119,14 +101,6 @@
 void SimpleHTMLFormatter::get_chunk(const int c, char* reply)
 {
     strcat(chunk, SIMPLE_HTML_CODE);
-    
-    if(reply != NULL && strlen(reply) != 0)
-    {
-        /*
-        strcat(chunk, "RPC reply : ");
-        strcat(chunk, reply);
-        */
-    }
         
     if(!RPCObjectManager::instance().is_empty())
     {
@@ -403,11 +377,9 @@
             strcat(chunk, "<option ");
             if(strcmp(_alarm.amPm,"AM") == 0){ strcat(chunk, "selected=\"selected\""); }
             strcat(chunk, "value=\"0\">AM</option>");
-            
             strcat(chunk, "<option ");
             if(strcmp(_alarm.amPm,"PM") == 0){ strcat(chunk, "selected=\"selected\""); }
             strcat(chunk, "value=\"1\">PM</option>");
-        
             strcat(chunk, "</select>");
             strcat(chunk, "<br><p>");
             strcat(chunk, "<input type=\"button\" value=\"Save\" onclick=\"javascript:submitAlarmPreferences();\">");
--- a/main.cpp	Sun Dec 07 20:37:08 2014 +0000
+++ b/main.cpp	Sun Dec 07 20:53:05 2014 +0000
@@ -30,7 +30,6 @@
 DigitalOut led2(LED2); // led 2 indicates delay time for interrupts
 DigitalOut led3(LED3); // Indicates the alarm has been set 
 DigitalOut led4(LED4);  // Indiciates the alarm is going off
-
 int alarmSignaled = 0;
 PwmOut alarm(p25);
 AnalogOut DACout(p18);
@@ -39,11 +38,9 @@
 SDFileSystem sd(p5, p6, p7, p8, p12, "sd"); //SD card
 FILE *wave_file;
 string filepath = "/sd/mymusic/";
-
 string weatherCondition = "";
 string lowTemperature = "";
 string highTemperature = "";
-
 volatile bool t = true;
 volatile bool play = true;
 volatile float vol = .52;
@@ -69,11 +66,9 @@
 // AC power line frequency
 const float powerlinefrequency=60.000;
 
-
 // Function prototypes
 HTTPServer create_simple_server();
 HTTPServer create_interactive_server();
-
 void stop_hit_callback(void);
 void snooze_hit_callback(void);
 void read_file_names(char *dir);