From 55475920fd1891307c3fed0e7062c1b95558bec3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Mar 2014 09:53:11 +0000 Subject: Fixed bug #471 except USB change. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6774 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c | 12 ++++++------ os/hal/ports/STM32/STM32F4xx/stm32_isr.h | 21 +++++++++++++++++++++ os/various/syscalls.c | 4 ++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c index 89b80396f..9a88bedf5 100644 --- a/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c +++ b/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c @@ -403,7 +403,7 @@ static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { * * @notapi */ -OSAL_IRQ_HANDLER(I2C1_EV_IRQHandler) { +OSAL_IRQ_HANDLER(STM32_I2C1_EVENT_HANDLER) { OSAL_IRQ_PROLOGUE(); @@ -415,7 +415,7 @@ OSAL_IRQ_HANDLER(I2C1_EV_IRQHandler) { /** * @brief I2C1 error interrupt handler. */ -OSAL_IRQ_HANDLER(I2C1_ER_IRQHandler) { +OSAL_IRQ_HANDLER(STM32_I2C1_ERROR_HANDLER) { uint16_t sr = I2CD1.i2c->SR1; OSAL_IRQ_PROLOGUE(); @@ -433,7 +433,7 @@ OSAL_IRQ_HANDLER(I2C1_ER_IRQHandler) { * * @notapi */ -OSAL_IRQ_HANDLER(I2C2_EV_IRQHandler) { +OSAL_IRQ_HANDLER(STM32_I2C2_EVENT_HANDLER) { OSAL_IRQ_PROLOGUE(); @@ -447,7 +447,7 @@ OSAL_IRQ_HANDLER(I2C2_EV_IRQHandler) { * * @notapi */ -OSAL_IRQ_HANDLER(I2C2_ER_IRQHandler) { +OSAL_IRQ_HANDLER(STM32_I2C2_ERROR_HANDLER) { uint16_t sr = I2CD2.i2c->SR1; OSAL_IRQ_PROLOGUE(); @@ -804,8 +804,8 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr, /* Resetting error flags for this transfer.*/ i2cp->errors = I2C_NO_ERROR; - /* Initializes driver fields, LSB = 1 -> receive.*/ - i2cp->addr = (addr << 1) | 0x01; + /* Initializes driver fields, LSB = 0 -> transmit.*/ + i2cp->addr = (addr << 1); /* Releases the lock from high level driver.*/ osalSysUnlock(); diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_isr.h b/os/hal/ports/STM32/STM32F4xx/stm32_isr.h index 0e936b3d6..dc7fbd1ab 100644 --- a/os/hal/ports/STM32/STM32F4xx/stm32_isr.h +++ b/os/hal/ports/STM32/STM32F4xx/stm32_isr.h @@ -54,6 +54,19 @@ #define STM32_CAN2_RX1_NUMBER 65 #define STM32_CAN2_SCE_NUMBER 66 +/* + * I2C units. + */ +#define STM32_I2C1_EVENT_HANDLER VectorBC +#define STM32_I2C1_ERROR_HANDLER VectorC0 +#define STM32_I2C1_EVENT_NUMBER 31 +#define STM32_I2C1_ERROR_NUMBER 32 + +#define STM32_I2C2_EVENT_HANDLER VectorC4 +#define STM32_I2C2_ERROR_HANDLER VectorC8 +#define STM32_I2C2_EVENT_NUMBER 33 +#define STM32_I2C2_ERROR_NUMBER 34 + /* * OTG units. */ @@ -123,8 +136,16 @@ #define STM32_UART4_NUMBER 52 #define STM32_UART5_NUMBER 53 #define STM32_USART6_NUMBER 71 + +/* + * Ethernet + */ +#define ETH_IRQHandler Vector134 + /** @} */ + + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ diff --git a/os/various/syscalls.c b/os/various/syscalls.c index b3918976c..41c04bac1 100644 --- a/os/various/syscalls.c +++ b/os/various/syscalls.c @@ -129,10 +129,10 @@ int _close_r(struct _reent *r, int file) caddr_t _sbrk_r(struct _reent *r, int incr) { -#if CH_USE_MEMCORE +#if CH_CFG_USE_MEMCORE void *p; - chDbgCheck(incr > 0, "_sbrk_r"); + chDbgCheck(incr > 0); p = chCoreAlloc((size_t)incr); if (p == NULL) { -- cgit v1.2.3