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.
Diff: main.cpp
- Revision:
- 1:5c7d8d760ece
- Parent:
- 0:3b35413050ff
- Child:
- 2:ac3746d21033
--- a/main.cpp Thu Aug 04 09:56:53 2011 +0000
+++ b/main.cpp Thu Aug 04 09:58:58 2011 +0000
@@ -1,16 +1,14 @@
#include "mbed.h"
#include "semaphore.h"
-Ticker printer1;
+Ticker ticker;
semaphore printSem;
-DigitalOut led1(LED1);
-DigitalOut led2(LED2);
volatile int sharedVariable;
#define SEM_ENABLE 1
-void print1()
+void incrementer()
{
#if SEM_ENABLE==1
if(semPend(&printSem, 5) == SEM_ERR)
@@ -28,7 +26,7 @@
{
sharedVariable = 0;
semInit(&printSem, 1);
- printer1.attach(&print1, 0.25);
+ ticker.attach(&incrementer, 0.25);
while(1)
{