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.
Fork of f by
Revision 1:d7c31658c3dd, committed 2017-12-23
- Comitter:
- radovan
- Date:
- Sat Dec 23 19:15:49 2017 +0000
- Parent:
- 0:7a5957039c5f
- Commit message:
- posledny-okomentovany
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| main.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 23 14:20:57 2017 +0000
+++ b/main.cpp Sat Dec 23 19:15:49 2017 +0000
@@ -1,5 +1,6 @@
#include "mbed.h"
#include "MMA8451Q.h"
+//#include "main.h"
#if defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
PinName const SDA = PTE25;
@@ -15,7 +16,7 @@
#endif
#define MMA8451_I2C_ADDRESS (0x1d<<1)
-///////////////////////////////////////
+
#define ELEVATOR_BUTTONf_FAMILY 0xc0
#define DIODEf_FAMILY 0x10
#define LIMIT_SWITCH_FAMILY 0xe0
@@ -102,8 +103,7 @@
kb=(kb+1)%200;
}
}
-/**
-*void prerusenieACC()
+/** void prerusenieACC()
*funkcia volana pri vzniknuti prerusenia od accelerometra
*posle simulatoru spravu pre zastavenie vytahu
*/
@@ -123,8 +123,7 @@
}
}
-/**
-*void main()
+/** void main()
*nastavuje akcelerometer pre vytvaranie prerusenia pre freefall
*spracovava v nekonecnej slucke spravy z kruhoveho buffera
*v pravidelnych intervaloch resetuje watchdog
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.h Sat Dec 23 19:15:49 2017 +0000
@@ -0,0 +1,34 @@
+
+
+/**
+*class main
+*trieda main koli dokumentacii
+*/
+class main {
+
+ public:
+/**
+*funkcia volana pri vzniknuti prerusenia pre citanie od serioveho portu
+*do kruhoveho buffera "bufpole" nacita 1 znak.
+*/
+void citaj();
+/**
+*funkcia pre poslanie spravy caka 200 milisekund na potvrdcujucu odpoved od simulatoru
+*inak opakuje poslanie spravy
+*@param <pokial> pocet znakov na odoslanie
+*/
+void posli(int pokial);
+/**
+*funkcia volana pre poslanie spravy na resetovanie watchdogu
+*/
+void watchdogReset();
+/**
+*funkcia volana pri vzniknuti freefall prerusenia od akcelerometra
+*/
+void prerusenieACC();
+/**
+*hlavna funkcia programu pokial bola prijata cela sprava tak podla nej posiela spravy simulatoru
+*pre jeho riadenie
+*/
+int main();
+};
\ No newline at end of file
