mbed w/ spi bug fig

Dependents:   display-puck

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Wed Jun 18 09:00:08 2014 +0100
Parent:
233:1bbc1451db33
Child:
235:685d5f11838f
Commit message:
Synchronized with git revision 2a4bbdfe4f273f3b7371abaf0280a109cb27fb1f

Full URL: https://github.com/mbedmicro/mbed/commit/2a4bbdfe4f273f3b7371abaf0280a109cb27fb1f/

[LPC1549] USBDevice support

Changed in this revision

targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/system_LPC11U6x.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC11U6X/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_NXP/TARGET_LPC15XX/serial_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/system_LPC11U6x.c	Tue Jun 17 11:30:08 2014 +0100
+++ b/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/system_LPC11U6x.c	Wed Jun 18 09:00:08 2014 +0100
@@ -474,7 +474,7 @@
  */
 void SystemInit (void) {
 #if (CLOCK_SETUP)
-  volatile uint32_t i, tmp;
+  volatile uint32_t i;
 #endif
   LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);
   LPC_SYSCON->SYSPLLCTRL    = SYSPLLCTRL_Val;
--- a/targets/hal/TARGET_NXP/TARGET_LPC11U6X/pwmout_api.c	Tue Jun 17 11:30:08 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC11U6X/pwmout_api.c	Wed Jun 18 09:00:08 2014 +0100
@@ -57,7 +57,7 @@
 void pwmout_init(pwmout_t* obj, PinName pin) {
     // determine the SPI to use
     PWMName pwm_mapped = (PWMName)pinmap_peripheral(pin, PinMap_PWM);
-    if (pwm_mapped == (uint32_t)NC) {
+    if (pwm_mapped == (PWMName)NC) {
         error("PwmOut pin mapping failed");
     }
     int sct_n = get_available_sct();
@@ -146,7 +146,6 @@
     } else if (value > 1.0f) {
         value = 1.0;
     }
-    uint32_t t_off = obj->pwm->MATCHREL0 - (uint32_t)((float)(obj->pwm->MATCHREL0) * value);
     uint32_t t_on = (uint32_t)((float)(obj->pwm->MATCHREL0) * value);
     obj->pwm->MATCHREL1 = t_on;
 }
--- a/targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c	Tue Jun 17 11:30:08 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c	Wed Jun 18 09:00:08 2014 +0100
@@ -128,7 +128,6 @@
     } else if (value > 1.0f) {
         value = 1.0;
     }
-    uint32_t t_off = pwm->MATCHREL0 - (uint32_t)((float)(pwm->MATCHREL0) * value);
     uint32_t t_on = (uint32_t)((float)(pwm->MATCHREL0) * value);
     pwm->MATCHREL1 = t_on;
 }
--- a/targets/hal/TARGET_NXP/TARGET_LPC15XX/serial_api.c	Tue Jun 17 11:30:08 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC15XX/serial_api.c	Wed Jun 18 09:00:08 2014 +0100
@@ -89,10 +89,10 @@
     if (pn != NC)
     {
         // check if we have any function mapped to this pin already and remove it
-        for (int n = 0; n < sizeof(LPC_SWM->PINASSIGN)/sizeof(*LPC_SWM->PINASSIGN); n ++) {
+        for (uint32_t n = 0; n < sizeof(LPC_SWM->PINASSIGN)/sizeof(*LPC_SWM->PINASSIGN); n ++) {
             regVal = LPC_SWM->PINASSIGN[n];
-            for (int j = 0; j <= 24; j += 8) {
-                if (((regVal >> j) & 0xFF) == pn)
+            for (uint32_t j = 0; j <= 24; j += 8) {
+                if (((regVal >> j) & 0xFF) == (uint32_t)pn)
                     regVal |= (0xFF << j);
             }
             LPC_SWM->PINASSIGN[n] = regVal;
@@ -105,7 +105,7 @@
 
 void serial_init(serial_t *obj, PinName tx, PinName rx) {
     int is_stdio_uart = 0;
-  
+    
     int uart_n = get_available_uart();
     if (uart_n == -1) {
         error("No available UART");
@@ -127,9 +127,8 @@
     LPC_SYSCON->SYSAHBCLKCTRL1 |= (1 << (17 + uart_n));
     
     /* Peripheral reset control to UART, a "1" bring it out of reset. */
-//    LPC_SYSCON->PRESETCTRL1 &= ~(0x1 << (17 + uart_n));
     LPC_SYSCON->PRESETCTRL1 |=  (0x1 << (17 + uart_n));
-    LPC_SYSCON->PRESETCTRL1 ^=  (0x1 << (17 + uart_n));
+    LPC_SYSCON->PRESETCTRL1 &= ~(0x1 << (17 + uart_n));
     
     UARTSysClk = SystemCoreClock / LPC_SYSCON->UARTCLKDIV;
     
@@ -143,9 +142,6 @@
     /* enable uart interrupts */
     NVIC_EnableIRQ((IRQn_Type)(UART0_IRQn + uart_n));
     
-    /* Enable UART interrupt */
-    // obj->uart->INTENSET = RXRDY | TXRDY | DELTA_RXBRK;
-    
     /* Enable UART */
     obj->uart->CFG |= UART_EN;