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:20b452641613
- Parent:
- 0:1913ea9baf30
--- a/main.cpp Thu Jun 12 05:34:52 2014 +0000
+++ b/main.cpp Thu Jun 12 09:03:02 2014 +0000
@@ -1,4 +1,4 @@
-// fc1114 - Frequency counter with i2c slave output
+// fc1114 - Frequency counter with i2c slave.
// target: LPC1114FN28
#include "mbed.h"
@@ -9,7 +9,7 @@
I2CSlave slave(dp5, dp27);
Ticker tick;
-uint32_t frq;
+volatile uint32_t frq;
void isr_tick(){
frq = LPC_TMR32B0->TC;
@@ -25,10 +25,9 @@
} buf;
char dummy[4];
+ led = 1;
tick.attach(&isr_tick, 1);
- led = 1;
-
LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 9);//TMR32B0 wakeup
LPC_IOCON->PIO1_5 |= (1 << 1);// Set PIN14 as CT32B0_CAP0
LPC_IOCON->PIO1_5 |= (1 << 5);// Hysteresis enable