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: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
Revision 137:28723fa54344, committed 2016-05-23
- Comitter:
- mbed_official
- Date:
- Mon May 23 15:15:12 2016 +0100
- Parent:
- 136:5728e9819171
- Child:
- 138:881eab8cab64
- Commit message:
- Synchronized with git revision b395dd5956dcbb5c3f4336d2d917210041741871
Full URL: https://github.com/mbedmicro/mbed/commit/b395dd5956dcbb5c3f4336d2d917210041741871/
Changed in this revision
| targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c Mon May 23 14:15:16 2016 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC81X/pwmout_api.c Mon May 23 15:15:12 2016 +0100
@@ -152,10 +152,18 @@
uint32_t t_off = (uint32_t)((float)(obj->pwm->MATCHREL[0].U) * value);
obj->pwm->MATCHREL[(obj->pwm_ch) + 1].U = t_off; // New endtime
+ // Clear OxRES (conflict resolution register) bit first, effect of simultaneous set and clear on output x
+ int offset = (obj->pwm_ch * 2);
+ obj->pwm->RES &= ~(0x3 << offset);
+
if (value == 0.0f) { // duty is 0%
+ // Clear output
+ obj->pwm->RES |= (0x2 << offset);
// Set CLR event to be same as SET event, makes output to be 0 (low)
obj->pwm->OUT[(obj->pwm_ch)].CLR = (1 << 0);
} else {
+ // Set output
+ obj->pwm->RES |= (0x1 << offset);
// Use normal CLR event (current SCT ch + 1)
obj->pwm->OUT[(obj->pwm_ch)].CLR = (1 << ((obj->pwm_ch) + 1));
}
