MOODSERIAL personal fork

Dependents:   rosserial_mbed_lib

Fork of MODSERIAL by Andy K

Files at this revision

API Documentation at this revision

Comitter:
garyservin
Date:
Wed Apr 30 00:34:41 2014 +0000
Parent:
25:ae0408ebdd68
Commit message:
Added support for KL25Z

Changed in this revision

INIT.cpp Show annotated file Show diff for this revision Revisions of this file
MODSERIAL.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/INIT.cpp	Tue Jan 08 18:01:03 2013 +0000
+++ b/INIT.cpp	Wed Apr 30 00:34:41 2014 +0000
@@ -37,6 +37,13 @@
 
     _base = LPC_USART;
     
+#elif defined MKL25Z4_H_
+    switch( _serial.index ) {
+        case 0: _base = UART0; break;
+        case 1: _base = UART1; break;
+        case 2: _base = UART2; break;
+        default: _base = NULL;      break;
+    }
 #else    
     switch( _serial.index ) {
         case 0: _base = LPC_UART0; break;
--- a/MODSERIAL.cpp	Tue Jan 08 18:01:03 2013 +0000
+++ b/MODSERIAL.cpp	Wed Apr 30 00:34:41 2014 +0000
@@ -89,6 +89,12 @@
 
 #ifdef __LPC11UXX_H__
     NVIC_DisableIRQ( UART_IRQn );
+#elif defined MKL25Z4_H_
+    switch( _serial.index ) {
+        case 0:   NVIC_DisableIRQ( UART0_IRQn ); break;
+        case 1:   NVIC_DisableIRQ( UART1_IRQn ); break;
+        case 2:   NVIC_DisableIRQ( UART2_IRQn ); break;
+    }
 #else
     switch( _serial.index ) {
         case 0:   NVIC_DisableIRQ( UART0_IRQn ); break;
@@ -104,6 +110,12 @@
 {
 #ifdef __LPC11UXX_H__
     NVIC_EnableIRQ( UART_IRQn );
+#elif defined MKL25Z4_H_
+    switch( _serial.index ) {
+        case 0:   NVIC_EnableIRQ( UART0_IRQn ); break;
+        case 1:   NVIC_EnableIRQ( UART1_IRQn ); break;
+        case 2:   NVIC_EnableIRQ( UART2_IRQn ); break;
+    }
 #else
     switch( _serial.index ) {
         case 0:   NVIC_EnableIRQ( UART0_IRQn ); break;