Skip to content

Commit

Permalink
Update UWBAdapter_PeripheralSTD_UART-IntRecv 10/29
Browse files Browse the repository at this point in the history
  • Loading branch information
Hom-Wang committed Oct 28, 2016
1 parent adb290d commit 5f58f18
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @file serial.c
* @author KitSprout
* @date 6-Oct-2016
* @date 28-Oct-2016
* @brief
*
*/
Expand Down Expand Up @@ -50,7 +50,7 @@
/* Private function prototypes -------------------------------------------------------------*/
/* Private functions -----------------------------------------------------------------------*/

void Serial_Config( void )
void Serial_Config( uint8_t interrupt )
{
GPIO_InitTypeDef GPIO_InitStruct;
USART_InitTypeDef UART_InitStruct;
Expand Down Expand Up @@ -93,7 +93,12 @@ void Serial_Config( void )
USART_Init(UARTx, &UART_InitStruct);

/* UART Enable ***************************************************************/
USART_ITConfig(UARTx, USART_IT_RXNE, ENABLE);
if (interrupt == ENABLE) {
USART_ITConfig(UARTx, USART_IT_RXNE, ENABLE);
}
else {
USART_ITConfig(UARTx, USART_IT_RXNE, DISABLE);
}
USART_Cmd(UARTx, ENABLE);
USART_ClearFlag(UARTx, USART_FLAG_TC);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/* Exported types --------------------------------------------------------------------------*/
/* Exported constants ----------------------------------------------------------------------*/
/* Exported functions ----------------------------------------------------------------------*/
void Serial_Config( void );
void Serial_Config( uint8_t interrupt );
void Serial_SendByte( uint8_t sendByte );
void Serial_SendData( uint8_t *sendData, uint16_t lens );
void Serial_SendStr( char *pWord );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ void UWBA_GPIO_Config( void )

void UWBA_UART_Config( pFunc pUARTx )
{
uint8_t interrupt = (pUARTx == NULL) ? DISABLE : ENABLE;
IRQEven_UART1 = pUARTx;

Serial_Config();
Serial_Config(interrupt);
printf("\r\nHello World!\r\n\r\n");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// <<< Use Configuration Wizard in Context Menu >>>

// <h>Debug MCU Configuration
// <o.0> DBG_SLEEP <i> Debug Sleep Mode
// <o.1> DBG_STOP <i> Debug Stop Mode
// <o.2> DBG_STANDBY <i> Debug Standby Mode
// </h>
DbgMCU_CR = 0x00000007;

// <h> Debug MCU APB1 Freeze
// <o.0> DBG_TIM2_STOP <i> Timer 2 Stopped when Core is halted
// <o.1> DBG_TIM3_STOP <i> Timer 3 Stopped when Core is halted
// <o.2> DBG_TIM4_STOP <i> Timer 4 Stopped when Core is halted
// <o.3> DBG_TIM5_STOP <i> Timer 5 Stopped when Core is halted
// <o.10> DBG_RTC_STOP <i> RTC Stopped when Core is halted
// <o.11> DBG_WWDG_STOP <i> Window Watchdog Stopped when Core is halted
// <o.12> DBG_IWDG_STOP <i> Independent Watchdog Stopped when Core is halted
// <o.21> DBG_I2C1_SMBUS_TIMEOUT <i> I2C1 SMBUS Timeout Mode Stopped when Core is halted
// <o.22> DBG_I2C2_SMBUS_TIMEOUT <i> I2C2 SMBUS Timeout Mode Stopped when Core is halted
// <o.23> DBG_I2C3_SMBUS_TIMEOUT <i> I2C3 SMBUS Timeout Mode Stopped when Core is halted
// </h>
DbgMCU_APB1_Fz = 0x00000000;


// <h> Debug MCU APB2 Freeze
// <o.0> DBG_TIM1_STOP <i> Timer 1 Stopped when Core is halted
// <o.16> DBG_TIM9_STOP <i> Timer 9 Stopped when Core is halted
// <o.17> DBG_TIM10_STOP <i> Timer 10 Stopped when Core is halted
// <o.18> DBG_TIM11_STOP <i> Timer 11 Stopped when Core is halted
// </h>
DbgMCU_APB2_Fz = 0x00000000;

// <<< end of configuration section >>>
Loading

0 comments on commit 5f58f18

Please sign in to comment.