Alexandre Salconi-Denis / Mbed 2 deprecated ProjetOctopode

Dependencies:   debug mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

Go to the documentation of this file.
00001 /**
00002 * @file main.cpp
00003 * @brief Formulaire principal du programme contact
00004 * @author Alexandre Salconi-Denis
00005 * @version 3.01
00006 * @date 06 mars 2014
00007 *
00008 * @mainpage
00009 * <b>Programme de sauvgarde de contact<br></b>
00010 * <em>Modifier par l'utilisation de Classe et d'operateur</em>
00011 * @author Alexandre Salconi-Denis
00012 * @section MainSection1 Description
00013 *
00014 *
00015 *
00016 * - <b>Version</b> : 3.01
00017 */
00018   
00019 //------------------------------------
00020 // Hyperterminal configuration
00021 // 9600 bauds, 8-bit data, no parity
00022 //------------------------------------
00023 
00024 #include "mbed.h"
00025 //#include "OSNAPprotocoleDefine.h"
00026 //#include "mouvement.h"
00027 #include "debug.h"
00028 #include "settingDebug.h"
00029 #include "AnsiGraphicalConsole.h "
00030 
00031 #include "source/Task/TTaskCritique.h"
00032 #include "source/Task/TTaskAlerte.h"
00033 #include "source/Task/TTaskGeneral.h"
00034 
00035 
00036 //#include <fcntl.h>
00037 //#include <io.h>
00038 //#include <stdio.h>
00039 //#include <iostream>
00040 
00041 
00042 DigitalOut myled(LED1, 0);
00043 DigitalIn mybutton(USER_BUTTON);
00044 DigitalOut pinA(PA_13);
00045 DigitalOut pinB(PA_14);
00046 
00047 int main()
00048 {
00049 wait(3);
00050 //////////
00051 // Boot //
00052 //////////
00053     
00054     #ifdef ENABLE_TASK_CRIT
00055         #ifdef DBG_MAIN_INIT
00056         debug("\n\rInit taskCritique ...");
00057         #endif
00058             TTaskCritique taskCritique(40);
00059         #ifdef DBG_MAIN_INIT 
00060         debug(" end taskCritique");
00061         #endif
00062     #endif
00063     
00064     #ifdef ENABLE_TASK_ALERT
00065         #ifdef DBG_MAIN_INIT
00066         debug("\n\rInit taskAlerte ...");
00067         #endif
00068             TTaskAlerte taskAlerte(20);// un-use because i dont know what to do with.
00069         #ifdef DBG_MAIN_INIT 
00070         debug(" end taskAlerte");
00071         #endif
00072     #endif
00073     
00074     #ifdef ENABLE_TASK_GEN
00075         #ifdef DBG_MAIN_INIT
00076         debug("\n\rInit taskGeneral ...");
00077         #endif
00078             TTaskGeneral taskGeneral(2/*0*/);
00079         #ifdef DBG_MAIN_INIT 
00080         debug(" end taskGeneral");
00081         #endif
00082     #endif
00083     
00084     
00085 
00086     while(1) {
00087      
00088         
00089         #ifdef ENABLE_TASK_CRIT
00090             #ifdef DBG_MAIN_FLAG
00091             debug("\n\r IN taskCritique");
00092             #endif
00093         
00094             taskCritique.exec();
00095         
00096             #ifdef DBG_MAIN_FLAG
00097             debug("  Out taskCritique");
00098             #endif
00099         #endif
00100         
00101         #ifdef ENABLE_TASK_ALERT
00102             #ifdef DBG_MAIN_FLAG
00103             debug("\n\r IN taskAlerte");
00104             #endif
00105             
00106             taskAlerte.exec();
00107         
00108             #ifdef DBG_MAIN_FLAG
00109             debug("  Out taskAlerte");
00110             #endif        
00111         #endif
00112         
00113         #ifdef ENABLE_TASK_GEN
00114             #ifdef DBG_MAIN_FLAG
00115             debug("\n\r IN taskGeneral");
00116             #endif
00117             
00118             taskGeneral.exec();
00119 
00120             #ifdef DBG_MAIN_FLAG
00121             debug("  Out taskGeneral");
00122             
00123             #endif
00124             
00125             #ifdef DBG_MAIN_DELAY_SEC
00126             debug("\n\r\n TICK \n\r\n");
00127             wait(DBG_MAIN_DELAY_SEC);
00128             #endif          
00129         #endif
00130         
00131         /*if (mybutton == 0) { // Button is pressed
00132             debug("Hello debug world");
00133             wait(2);
00134             
00135             myled = !myled;
00136             wait(1);
00137         }*/
00138 
00139     }
00140     
00141 }