chore: sdk compiles almost w/o warnings?

This commit is contained in:
2024-12-17 03:13:08 +06:00
parent 31efbc726f
commit 7c7b36a6b3
55 changed files with 658 additions and 514 deletions

View File

@@ -66,8 +66,8 @@ void ADC_ReceiveBuf_ACUT(u32 *pBuf)
while (1) {
isr = ADC_GetISR();
if (isr & (BIT_ADC_FIFO_FULL | BIT_ADC_FIFO_RD_REQ)) {
*pBuf = (u32)ADC_Read_RAM();
*(pBuf+1)= (u32)ADC_Read_RAM();
*pBuf = (u32)ADC_Read();
*(pBuf+1)= (u32)ADC_Read();
ADC_INTClear();
ADC_INTConfig(BIT_ADC_FIFO_FULL_EN|BIT_ADC_FIFO_RD_REQ_EN, DISABLE);

View File

@@ -84,6 +84,8 @@ static u32 EFUSE_OTP_Check(u16 Addr, u8 Data)
* @brief Get remaining efuse length
* @retval remaining efuse length
*/
_LONG_CALL_ int EFUSE_RemainLength(void);
int efuse_get_remaining_length(void)
{
return EFUSE_RemainLength();
@@ -293,6 +295,21 @@ void efuse_rdp_keyset(u8 *rdp_key)
* @param SW_Key: key for encyption
* @note none
*/
_LONG_CALL_ int aes_init(void);
_LONG_CALL_ int aes_encrypt_key(
const unsigned char *key,
const int key_len,
aes_encrypt_ctx *ctx
);
_LONG_CALL_ int aes_ecb_encrypt(
const unsigned char *in,
unsigned char *out,
int length,
aes_encrypt_ctx *ctx
);
void efuse_rdp_check_image_encrypt(u8* SW_Key)
{
@@ -301,7 +318,7 @@ void efuse_rdp_check_image_encrypt(u8* SW_Key)
u8 * pByte;
pByte = (u8 *)&rdp_bin_checksum;
memset(&enc_ctx, 0, sizeof(enc_ctx));
_memset(&enc_ctx, 0, sizeof(enc_ctx));
/*calculate checksum using plaintext*/
for(i=0; i<4; i++) {
@@ -488,7 +505,7 @@ void efuse_otf_keyset(u8 *otf_key)
IMAGE2_RAM_TEXT_SECTION
void efuse_otf_check(uint32_t origin_data)
{
extern char set_key[40];
char set_key[40];
FLASH_Write_Lock();
uint32_t data = 0;
u8 otf_iv[16]={0x21, 0x32, 0x53, 0x64, 0x75, 0x86, 0xa7, 0xb8,

View File

@@ -46,7 +46,7 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
GPIO_InitStruct.GPIO_ITTrigger = GPIO_INT_Trigger_EDGE;
GPIO_InitStruct.GPIO_ITPolarity = GPIO_INT_POLARITY_ACTIVE_LOW;
InterruptRegister(GPIO_INTHandler, GPIO_IRQ, NULL, 10);
InterruptRegister(GPIO_INTHandler, GPIO_IRQ, 0, 10);
InterruptEn(GPIO_IRQ, 10);
GPIO_Init(&GPIO_InitStruct);

View File

@@ -99,7 +99,7 @@ void i2s_init(i2s_t *obj, PinName sck, PinName ws, PinName sd_tx, PinName sd_rx,
I2S_StructInit(&I2SInitStruct);
/*I2S Interrupt Initialization*/
InterruptRegister((IRQ_FUN) i2s_isr, I2S0_PCM0_IRQ, NULL, 3);
InterruptRegister((IRQ_FUN) i2s_isr, I2S0_PCM0_IRQ, 0, 3);
InterruptEn(I2S0_PCM0_IRQ, 3);
/* enable system pll */

View File

@@ -17,9 +17,6 @@
#include "rtc_api.h"
#include <time.h>
#include "timer_api.h"
static struct tm rtc_timeinfo;
static int rtc_en = 0;
static alarm_irq_handler rtc_alarm_handler;
@@ -158,6 +155,7 @@ void rtc_backup_timeinfo(void)
* @param none
* @retval none
*/
void rtc_init(void)
{
RTC_InitTypeDef RTC_InitStruct;

View File

@@ -15,6 +15,9 @@
*/
#include "wait_api.h"
#include "us_ticker_api.h"
#include "basic_types.h"
_LONG_CALL_ void DelayUs(u32 us);
void wait(float s)
{