Skip to content

correct SPI pinmap typo #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libraries/mbed/common/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
#include "semihost_api.h"
#include "mbed_interface.h"
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif

#ifdef TOOLCHAIN_GCC_CW
// TODO: Ideally, we would like to define directly "_ExitProcess"
Expand All @@ -23,6 +26,11 @@ void mbed_exit(int return_code) {
void exit(int return_code) {
#endif

#if DEVICE_STDIO_MESSAGES
fflush(stdout);
fflush(stderr);
#endif

#if DEVICE_SEMIHOST
if (mbed_interface_connected()) {
semihost_exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
break;

default:
error("gpio_irq only supported on port A-E.\n");
error("gpio_irq only supported on port A-E.");
break;
}
NVIC_SetVector(irq_n, vector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b

// 8 data bits = 0 ... 9 data bits = 1
if ((data_bits < 8) || (data_bits > 9))
error("Invalid number of bits (%d) in serial format, should be 8..9\r\n", data_bits);
error("Invalid number of bits (%d) in serial format, should be 8..9", data_bits);

data_bits -= 8;

Expand All @@ -136,13 +136,13 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
case ParityOdd : parity_enable = 1; parity_select = 1; data_bits++; break;
case ParityEven: parity_enable = 1; parity_select = 0; data_bits++; break;
default:
error("Invalid serial parity setting\r\n");
error("Invalid serial parity setting");
return;
}

// 1 stop bits = 0, 2 stop bits = 1
if ((stop_bits != 1) && (stop_bits != 2))
error("Invalid stop bits specified\r\n");
error("Invalid stop bits specified");
stop_bits -= 1;

uint32_t m10 = 0;
Expand All @@ -151,7 +151,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
if (data_bits == 2) {
// only uart0 supports 10 bit communication
if (obj->index != 0)
error("Invalid number of bits (9) to be used with parity\r\n");
error("Invalid number of bits (9) to be used with parity");
data_bits = 0;
m10 = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
break;

default:
error("gpio_irq only supported on Port A and B\n");
error("gpio_irq only supported on Port A and B");
break;
}
NVIC_SetVector(irq_n, vector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
break;

default:
error("gpio_irq only supported on port A and D\n");
error("gpio_irq only supported on port A and D");
break;
}
NVIC_SetVector(irq_n, vector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
break;

default:
error("gpio_irq only supported on port A,C and D\n");
error("gpio_irq only supported on port A,C and D");
break;
}
NVIC_SetVector(irq_n, vector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b

// TODO: Support other number of data bits (also in the write method!)
if ((data_bits < 8) || (data_bits > 8)) {
error("Invalid number of bits (%d) in serial format, should be 8\r\n", data_bits);
error("Invalid number of bits (%d) in serial format, should be 8", data_bits);
}

uint8_t parity_enable, parity_select;
Expand All @@ -168,13 +168,13 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
case ParityOdd : parity_enable = 1; parity_select = 1; data_bits++; break;
case ParityEven: parity_enable = 1; parity_select = 0; data_bits++; break;
default:
error("Invalid serial parity setting\r\n");
error("Invalid serial parity setting");
return;
}

// 1 stop bits = 0, 2 stop bits = 1
if ((stop_bits != 1) && (stop_bits != 2)) {
error("Invalid stop bits specified\r\n");
error("Invalid stop bits specified");
}
stop_bits -= 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#define DEVICE_DEBUG_AWARENESS 0

#define DEVICE_STDIO_MESSAGES 0
#define DEVICE_STDIO_MESSAGES 1

#define DEVICE_ERROR_RED 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
break;

default:
error("gpio_irq only supported on port A-E.\n");
error("gpio_irq only supported on port A-E.");
break;
}
NVIC_SetVector(irq_n, vector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ static const PinMap PinMap_SPI_MOSI[] = {
{PTB16, SPI_1, 2},
{PTB22, SPI_2, 2},
{PTC6 , SPI_0, 2},
{PTD2 , SPI_0, 2},
{PTD6 , SPI_0, 7},
{PTD6 , SPI_1, 7},
{NC , NC , 0}
};

Expand All @@ -55,7 +54,6 @@ static const PinMap PinMap_SPI_MISO[] = {
{PTB17, SPI_1, 2},
{PTB23, SPI_2, 2},
{PTC7 , SPI_0, 2},
{PTD3 , SPI_0, 2},
{PTD7 , SPI_1, 7},
{NC , NC , 0}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32

// Interrupts available only on GPIO0 and GPIO2
if (obj->port != LPC_GPIO0_BASE && obj->port != LPC_GPIO2_BASE) {
error("pins on this port cannot generate interrupts\n");
error("pins on this port cannot generate interrupts");
}

// put us in the interrupt table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32

// Interrupts available only on GPIO0 and GPIO2
if (obj->port != LPC_GPIO0_BASE && obj->port != LPC_GPIO2_BASE) {
error("pins on this port cannot generate interrupts\n");
error("pins on this port cannot generate interrupts");
}

// put us in the interrupt table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32

// Interrupts available only on GPIO0 and GPIO2
if (obj->port != LPC_GPIO0_BASE && obj->port != LPC_GPIO2_BASE) {
error("pins on this port cannot generate interrupts\n");
error("pins on this port cannot generate interrupts");
}

// put us in the interrupt table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 2;
break;
default:
error("This pin is not supported\n");
error("This pin is not supported");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 3;
break;
default:
error("This pin is not supported with InterruptIn.\n");
error("This pin is not supported with InterruptIn.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 6;
break;
default:
error("InterruptIn error: pin not supported.\n");
error("InterruptIn error: pin not supported.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 2;
break;
default:
error("This pin is not supported\n");
error("This pin is not supported");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 3;
break;
default:
error("This pin is not supported with InterruptIn.\n");
error("This pin is not supported with InterruptIn.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 6;
break;
default:
error("This pin is not supported with InterruptIn.\n");
error("This pin is not supported with InterruptIn.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 6;
break;
default:
error("InterruptIn error: pin not supported.\n");
error("InterruptIn error: pin not supported.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 3;
break;
default:
error("This pin is not supported with InterruptIn.\n");
error("This pin is not supported with InterruptIn.");
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
irq_index = 6;
break;
default:
error("This pin is not supported with InterruptIn.\n");
error("This pin is not supported with InterruptIn.");
return -1;
}

Expand Down