11.串口收发实验(2)

2019-01-18 18:40

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


11.串口收发实验(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:大学英语听力教程上册unit9原文及答案

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: