欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
HC32F460的IAP例程與資料
[打印本頁]
作者:
pp8899
時間:
2021-6-23 18:25
標題:
HC32F460的IAP例程與資料
這是華大的HC32F460的IAP例程,供大家參考。
51hei.png
(8.04 KB, 下載次數: 116)
下載附件
2021-6-23 19:11 上傳
以上資料下載:
hc32f460_iap資料.7z
(3.11 MB, 下載次數: 215)
2021-6-23 19:14 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
/*******************************************************************************
* Include files
******************************************************************************/
#include "iap.h"
#include "basic.h"
#include "flash.h"
#include "uart.h"
#include "modem.h"
#include "User_Timer.h"
/*******************************************************************************
* Local type definitions ('typedef')
******************************************************************************/
/*******************************************************************************
* Local pre-processor symbols/macros ('#define')
******************************************************************************/
/*******************************************************************************
* Global variable definitions (declared in header file with 'extern')
******************************************************************************/
uint32_t JumpAddress;
func_ptr_t JumpToApplication;
/*******************************************************************************
* Local function prototypes ('static')
******************************************************************************/
static en_result_t IAP_JumpToApp(uint32_t u32Addr);
static void IAP_ResetConfig(void);
/*******************************************************************************
* Local variable definitions ('static')
******************************************************************************/
/*******************************************************************************
* Function implementation - global ('extern') and local ('static')
******************************************************************************/
/**
*******************************************************************************
** \brief Initialize IAP
**
** \param [in] None
**
** \retval None
**
******************************************************************************/
void IAP_Init(void)
{
SystemClock_Init();
LED_Init();
UART_Init();
}
/**
*******************************************************************************
** \brief UART receive byte.
**
** \param [out] u8RxData Pointer to Rx data.
**
** \retval Ok Receive data finished.
** \retval Error Don't receive data.
**
******************************************************************************/
void IAP_Main(void)
{
uint32_t u32AppFlag;
en_result_t enRet;
while (1)
{
enRet = Modem_Process(BOOT_WAIT_TIME);
if ((enRet == Ok) || (enRet == ErrorTimeout))
{
u32AppFlag = *(__IO uint32_t *)BOOT_PARA_ADDRESS;
if ((0xFFFF != u32AppFlag))
{
if (Error == IAP_JumpToApp(APP_ADDRESS))
{
LED0_OFF();
LED1_ON();
}
}
else
{
LED0_ON();
LED1_ON();
}
}
else
{
LED1_OFF();
LED0_ON();
}
}
}
/**
*******************************************************************************
** \brief IAP main function
**
** \param [in] u32Addr APP address
**
** \retval Error APP address error
**
******************************************************************************/
static en_result_t IAP_JumpToApp(uint32_t u32Addr)
{
uint32_t u32StackTop = *((__IO uint32_t *)u32Addr);
/* Check if user code is programmed starting from address "u32Addr" */
/* Check stack top pointer. */
if ((u32StackTop > SRAM_BASE) && (u32StackTop <= (SRAM_BASE + RAM_SIZE)))
{
IAP_ResetConfig();
/* Jump to user application */
JumpAddress = *(__IO uint32_t *)(u32Addr + 4);
JumpToApplication = (func_ptr_t)JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t *)u32Addr);
JumpToApplication();
}
return Error;
}
/**
*******************************************************************************
** \brief Boot reset configure
**
** \param [in] None
**
** \retval None
**
******************************************************************************/
static void IAP_ResetConfig(void)
{
LED_DeInit();
UART_DeInit();
Timer_DeInit();
SystemClock_DeInit();
}
/******************************************************************************
* EOF (not truncated)
*****************************************************************************/
復制代碼
作者:
yutouyes
時間:
2021-9-2 16:49
好資料,51黑有你更精彩!!!
作者:
cliff_w
時間:
2022-3-31 16:28
感謝感謝,找了很久終于找到了
作者:
150315175
時間:
2022-4-26 09:53
這個資料在哪里找的啊?我去官網都沒找到
作者:
mmloster001
時間:
2023-3-13 22:01
感謝,,,,馬上下載來研究研究
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1