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.
Revision 0:484d9f94f221, committed 2018-03-12
- Comitter:
- Rhyme
- Date:
- Mon Mar 12 05:34:14 2018 +0000
- Commit message:
- commit before publishing
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Mar 12 05:34:14 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+Ticker *tokei ;
+uint32_t edge_time = 0 ;
+
+void inc_sec(void)
+{
+ __disable_irq() ; // Disable Interrupts
+ edge_time++ ;
+ __enable_irq() ; // Enable Interrupts
+}
+
+void init_timer(void)
+{
+ tokei = new Ticker() ;
+ tokei->attach(inc_sec, 1.0) ;
+}
+
+int main() {
+ uint32_t count = 0 ;
+ init_timer() ;
+
+ printf("Ticker test program\n") ;
+ while(1) {
+ printf("%d: %d\n", count++, edge_time) ;
+ wait(1.0) ;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 12 05:34:14 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file