Merge branch 'master' of github.com:PX4/Firmware

This commit is contained in:
Lorenz Meier
2012-09-14 10:26:05 +02:00
8 changed files with 206 additions and 47 deletions
+9
View File
@@ -1198,6 +1198,10 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv)
{
stm32_i2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt);
#ifdef CONFIG_I2C_POLLED
//irqstate_t state = irqsave();
#endif
/* Receive a byte */
*priv->ptr++ = stm32_i2c_getreg(priv, STM32_I2C_DR_OFFSET);
@@ -1209,6 +1213,11 @@ static int stm32_i2c_isr(struct stm32_i2c_priv_s *priv)
stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0);
}
priv->dcnt--;
#ifdef CONFIG_I2C_POLLED
//irqrestore(state);
#endif
}
}
+14 -10
View File
@@ -956,7 +956,8 @@ static int up_setup(struct uart_dev_s *dev)
/* Set up the cached interrupt enables value */
priv->ie = 0;
up_restoreusartint(priv, 0);
return OK;
}
@@ -976,12 +977,15 @@ static int up_dma_setup(struct uart_dev_s *dev)
int result;
uint32_t regval;
/* Do the basic UART setup first */
/* Do the basic UART setup first, unless we are the console */
result = up_setup(dev);
if (result != OK)
{
return result;
if (!dev->isconsole)
{
result = up_setup(dev);
if (result != OK)
{
return result;
}
}
/* Acquire the DMA channel. This should always succeed. */
@@ -1941,10 +1945,10 @@ void stm32_serial_dma_poll(void)
int up_putc(int ch)
{
#if CONSOLE_UART > 0
struct up_dev_s *priv = uart_devs[CONSOLE_UART - 1];
uint16_t ie;
// struct up_dev_s *priv = uart_devs[CONSOLE_UART - 1];
// uint16_t ie;
up_disableusartint(priv, &ie);
// up_disableusartint(priv, &ie);
/* Check for LF */
@@ -1956,7 +1960,7 @@ int up_putc(int ch)
}
up_lowputc(ch);
up_restoreusartint(priv, ie);
// up_restoreusartint(priv, ie);
#endif
return ch;
}