Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed RTC
Revision 2:ebbca46b415f, committed 2016-01-25
- Comitter:
- manl2003
- Date:
- Mon Jan 25 18:03:29 2016 +0000
- Parent:
- 1:7b379ec59b5d
- Child:
- 3:1c077a1de3e5
- Commit message:
- asd
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Jan 24 20:36:08 2016 +0000
+++ b/main.cpp Mon Jan 25 18:03:29 2016 +0000
@@ -55,7 +55,15 @@
#define NIVEAU_DC_ANAL 3.3
#define SEUIL_ANAL 1.125
+struct AnalArgs
+{
+ AnalogIn* In;
+ //Mailbox
+};
+
void lecture_analog(void const *args) {
+ AnalArgs *analArgs = (AnalArgs*)args;
+
bool premiereLectureDispo = false;
int echantillonsAnal[5] = {0, 0, 0, 0, 0};
int compteur = 0;
@@ -64,8 +72,7 @@
while (true)
{
// lecture des échantillons analogiques
- //TODO soit inclure ea_2, soit rendre la méthode réutilisable (plus nice)
- echantillonsAnal[compteur] = ea_1;
+ echantillonsAnal[compteur] = *analArgs->In;
// calcul de la nouvelle moyenne courante
if(premiereLectureDispo == true)
{
@@ -92,15 +99,22 @@
}
+struct NumArgs
+{
+ DigitalIn *In;
+};
+
void lecture_num(void const *args) {
+ NumArgs *numArgs = (NumArgs*)args;
+
bool lecture, lecturePrecedente;
while (true)
{
// lecture des échantillons numériques
//TODO, généralisé la fonction
- bool lectureDebut = en_1.read();
+ bool lectureDebut = numArgs->In->read();
wait_ms(FREQ_NUM_STAB_MS);
- if(lectureDebut == en_1.read())
+ if(lectureDebut == numArgs->In->read())
{
}