diff options
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/include/drivers/spi.h | 10 | ||||
| -rw-r--r-- | components/drivers/serial/serial.c | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h index 65d9b26cb5..a9faf933ad 100644 --- a/components/drivers/include/drivers/spi.h +++ b/components/drivers/include/drivers/spi.h @@ -9,13 +9,19 @@ * * Change Logs: * Date Author Notes + * 2012-11-23 Bernard Add extern "C" */ #ifndef __SPI_H__ #define __SPI_H__ +#include <stdlib.h> #include <rtthread.h> +#ifdef __cplusplus +extern "C"{ +#endif + #define RT_SPI_CPHA (1<<0) /* bit[0]:CPHA, clock phase */ #define RT_SPI_CPOL (1<<1) /* bit[1]:CPOL, clock polarity */ /** @@ -247,4 +253,8 @@ rt_inline void rt_spi_message_append(struct rt_spi_message *list, message->next = RT_NULL; } +#ifdef __cplusplus +} +#endif + #endif diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 50f4f106db..f73325a440 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -12,6 +12,7 @@ * 2006-03-13 bernard first version * 2012-05-15 lgnq modified according bernard's implementation. * 2012-05-28 bernard code cleanup + * 2012-11-23 bernard fix compiler warning. */ #include <rthw.h> @@ -427,7 +428,7 @@ void rt_hw_serial_isr(struct rt_serial_device *serial) */ void rt_hw_serial_dma_tx_isr(struct rt_serial_device *serial) { - void *data_ptr; + const void *data_ptr; rt_size_t data_size; if (RT_EOK == rt_data_queue_pop(&(serial->tx_dq), &data_ptr, &data_size, 0)) |
