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.
Fork of Multi_WS2811 by
Revision 2:8adaf48544cc, committed 2014-11-15
- Comitter:
- antoniorohit
- Date:
- Sat Nov 15 01:23:27 2014 +0000
- Parent:
- 1:9d9f7bfad0ce
- Commit message:
- Changed port to C (PTC)
Changed in this revision
| WS2811.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WS2811.cpp Fri Nov 14 08:17:04 2014 +0000
+++ b/WS2811.cpp Sat Nov 15 01:23:27 2014 +0000
@@ -31,7 +31,7 @@
// #define DEBUG_PIN 4 /* PTD4 debugOut */
#ifdef DEBUG_PIN
-#define DEBUG 1
+#define DEBUG 0
#endif
#if DEBUG
@@ -44,8 +44,8 @@
#define SET_DEBUG (void)0
#endif
-static PORT_Type volatile * const IO_PORT = PORTD;
-static GPIO_Type volatile * const IO_GPIO = PTD;
+static PORT_Type volatile * const IO_PORT = PORTC;
+static GPIO_Type volatile * const IO_GPIO = PTC;
// 48 MHz clock, no prescaling.
#define NSEC_TO_TICKS(nsec) ((nsec)*48/1000)
@@ -126,7 +126,7 @@
/// Enable PORTD, DMA and TPM0 clocking
void WS2811::clock_init()
{
- SIM->SCGC5 |= SIM_SCGC5_PORTD_MASK;
+ SIM->SCGC5 |= SIM_SCGC5_PORTC_MASK;
SIM->SCGC6 |= SIM_SCGC6_DMAMUX_MASK | SIM_SCGC6_TPM0_MASK; // Enable clock to DMA mux and TPM0
SIM->SCGC7 |= SIM_SCGC7_DMA_MASK; // Enable clock to DMA
