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
This commit is contained in:
gdisirio 2014-03-16 09:53:11 +00:00
parent c3f7c51a7d
commit 55475920fd
3 changed files with 29 additions and 8 deletions

View File

@ -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();

View File

@ -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. */
/*===========================================================================*/

View File

@ -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) {