* @brief Configures the nested vectored interrupt controller. * @param None * @retvalNone */
voidNVIC_Configuration(void) {
NVIC_InitTypeDefNVIC_InitStructure;
/* Configure the NVIC Preemption Priority Bits */ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
/* Enable the USART1 Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);
/* Enable the USART2 Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } /**
* @brief Compares two buffers.
* @param pBuffer1, pBuffer2: buffers to be compared. * @paramBufferLength: buffer's length
* @retval PASSED: pBuffer1 identical to pBuffer2 * FAILED: pBuffer1 differs from pBuffer2 */
TestStatusBuffercmp(uint8_t* pBuffer1, uint8_t* pBuffer2, uint16_t BufferLength) {
while(BufferLength--) {
if(*pBuffer1 != *pBuffer2) {
return FAILED; }
pBuffer1++; pBuffer2++; }
return PASSED; }
#ifdef USE_FULL_ASSERT /**
* @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name
* @param line: assert_param error line source number * @retvalNone */
voidassert_failed(uint8_t* file, uint32_t line) {
/* User can add his own implementation to report the file name and line number, ex: printf(\
/* Infinite loop */ while (1) { } }
#endif /** * @} */ /** * @} */
/*****END OF FILE****/