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

@@ -32,6 +32,8 @@
extern "C" {
#endif
extern void RTC_ClokSource(u32 Source);
/** @addtogroup rtc RTC
* @ingroup hal
* @brief rtc functions
@@ -47,10 +49,10 @@ extern "C" {
typedef void (*alarm_irq_handler)(void);
struct alarm_s {
uint32_t yday;//which day of the year
uint32_t hour;
uint32_t min;
uint32_t sec;
uint32_t sec; /* Seconds */
uint32_t min; /* Minutes */
uint32_t hour; /* Hours */
uint32_t yday; /* Day of year */
};
typedef struct alarm_s alarm_t;
@@ -123,6 +125,11 @@ void rtc_disable_alarm(void);
///@}
#endif //CONFIG_PLATFORM_8711B || CONFIG_PLATFORM_8195BLP || CONFIG_PLATFORM_8721D || CONFIG_PLATFORM_8710C
/**
* @brief Backup RTC time information before system reset
*/
void rtc_backup_timeinfo(void);
/*\@}*/
#ifdef __cplusplus

View File

@@ -1,14 +0,0 @@
/* mbed Microcontroller Library - CMSIS
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
*
* A generic CMSIS include header, pulling in RTL8195A specifics
*/
#ifndef MBED_CMSIS_H
#define MBED_CMSIS_H
#include <platform/platform_stdlib.h>
#include <hal_platform.h>
#endif

View File

@@ -1,14 +0,0 @@
/* mbed Microcontroller Library - CMSIS
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
*
* A generic CMSIS include header, pulling in RTL8195A specifics
*/
#ifndef MBED_CMSIS_H
#define MBED_CMSIS_H
#include <platform/platform_stdlib.h>
#include <hal_platform.h>
#endif

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)
{