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.
main.cpp
00001 #include "mbed.h" 00002 Ticker *tokei ; 00003 uint32_t edge_time = 0 ; 00004 00005 void inc_sec(void) 00006 { 00007 __disable_irq() ; // Disable Interrupts 00008 edge_time++ ; 00009 __enable_irq() ; // Enable Interrupts 00010 } 00011 00012 void init_timer(void) 00013 { 00014 tokei = new Ticker() ; 00015 tokei->attach(inc_sec, 1.0) ; 00016 } 00017 00018 int main() { 00019 uint32_t count = 0 ; 00020 init_timer() ; 00021 00022 printf("Ticker test program\n") ; 00023 while(1) { 00024 printf("%d: %d\n", count++, edge_time) ; 00025 wait(1.0) ; 00026 } 00027 }
Generated on Tue Jul 19 2022 15:01:56 by
1.7.2