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.
Dependents: oldheating gps motorhome heating
Revision 68:807c1c7b2c22, committed 2019-10-07
- Comitter:
- andrewboyson
- Date:
- Mon Oct 07 07:19:18 2019 +0000
- Parent:
- 67:c44c5c90e35a
- Child:
- 69:4e48d3859b87
- Commit message:
- Include arm_compat.h to allow the use of the __[en/dis]able_irq intrinsics.
Changed in this revision
| clk/clktime.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/clk/clktime.c Fri Sep 27 11:29:57 2019 +0000
+++ b/clk/clktime.c Mon Oct 07 07:19:18 2019 +0000
@@ -1,5 +1,6 @@
#include <stdint.h>
#include <stdbool.h>
+#include <arm_compat.h> //Used for the __[en/dis]able_irq intrinsics
#include "rtc.h"
#include "tm.h"
@@ -29,25 +30,21 @@
clktime fraction = (timerCountSinceLastSecond << CLK_TIME_ONE_SECOND_SHIFT) / HR_TIMER_COUNT_PER_SECOND;
clktime ticks = extClock - fraction;
- //__disable_irq();
- __asm("CPSID I");
+ __disable_irq();
tickCount = ticks;
slewCount = 0;
- //__enable_irq();
- __asm("CPSIE I");
+ __enable_irq();
countIsSet = true;
}
void ClkTimeIncrementByOneSecond(uint32_t startCount)
{
- //__disable_irq();
- __asm("CPSID I");
+ __disable_irq();
hrTimerAtLastIncrement = startCount;
tickCount += CLK_TIME_ONE_SECOND + ClkGovGetPpb();
slewCount += ClkGovGetSlew();
ClkGovSetSlew(0);
- //__enable_irq();
- __asm("CPSIE I");
+ __enable_irq();
}
static volatile clktime tickSnapshot;