This commit is contained in:
Man, Jianting (Meco) 2022-07-22 23:53:42 -04:00 committed by GitHub
parent f82705db1d
commit 9595df24f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 188 additions and 182 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2022, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *

View File

@ -0,0 +1,6 @@
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- N32G45x_Firmware_Library

View File

@ -40,10 +40,10 @@ if GetDepend(['RT_USING_DAC']):
if GetDepend(['RT_USING_CAN']): if GetDepend(['RT_USING_CAN']):
src += ['drv_can.c'] src += ['drv_can.c']
if GetDepend(['BSP_USING_RTC']): if GetDepend(['RT_USING_RTC']):
src += ['drv_rtc.c'] src += ['drv_rtc.c']
if GetDepend(['BSP_USING_WDT']): if GetDepend(['RT_USING_WDT']):
src += ['drv_wdt.c'] src += ['drv_wdt.c']
path = [cwd] path = [cwd]

View File

@ -183,6 +183,6 @@ int rt_hw_adc_init(void)
INIT_DEVICE_EXPORT(rt_hw_adc_init); INIT_DEVICE_EXPORT(rt_hw_adc_init);
#endif /* defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) || defined(BSP_USING_ADC3) || defined(BSP_USING_ADC4) */ #endif /* defined(BSP_USING_ADC1) || defined(BSP_USING_ADC2) || defined(BSP_USING_ADC3) || defined(BSP_USING_ADC4) */
#endif /* RT_USING_ADC */ #endif /* RT_USING_ADC */

View File

@ -425,7 +425,7 @@ int rt_hw_i2c_init(void)
{ {
#ifdef RT_USING_I2C_BITOPS #ifdef RT_USING_I2C_BITOPS
rt_size_t obj_num = sizeof(i2c_obj) / sizeof(struct n32_i2c); rt_size_t obj_num = sizeof(i2c_obj) / sizeof(struct n32_i2c);
rt_err_t result; rt_err_t result;
for(int i = 0; i < obj_num; i++) for(int i = 0; i < obj_num; i++)

View File

@ -42,7 +42,7 @@ uint32_t SynchPrediv, AsynchPrediv;
static rt_err_t n32_rtc_get_timeval(struct timeval *tv) static rt_err_t n32_rtc_get_timeval(struct timeval *tv)
{ {
struct tm tm_new = {0}; struct tm tm_new = {0};
RTC_DateType RTC_DateStructure; RTC_DateType RTC_DateStructure;
RTC_TimeType RTC_TimeStructure; RTC_TimeType RTC_TimeStructure;
@ -52,7 +52,7 @@ static rt_err_t n32_rtc_get_timeval(struct timeval *tv)
tm_new.tm_sec = RTC_TimeStructure.Seconds; tm_new.tm_sec = RTC_TimeStructure.Seconds;
tm_new.tm_min = RTC_TimeStructure.Minutes; tm_new.tm_min = RTC_TimeStructure.Minutes;
tm_new.tm_hour = RTC_TimeStructure.Hours; tm_new.tm_hour = RTC_TimeStructure.Hours;
tm_new.tm_wday = RTC_DateStructure.WeekDay; tm_new.tm_wday = RTC_DateStructure.WeekDay;
tm_new.tm_mday = RTC_DateStructure.Date; tm_new.tm_mday = RTC_DateStructure.Date;
tm_new.tm_mon = RTC_DateStructure.Month - 1; tm_new.tm_mon = RTC_DateStructure.Month - 1;
tm_new.tm_year = RTC_DateStructure.Year + 100; tm_new.tm_year = RTC_DateStructure.Year + 100;
@ -64,7 +64,7 @@ static rt_err_t n32_rtc_get_timeval(struct timeval *tv)
static rt_err_t set_rtc_time_stamp(time_t time_stamp) static rt_err_t set_rtc_time_stamp(time_t time_stamp)
{ {
struct tm time = {0}; struct tm time = {0};
RTC_DateType RTC_DateStructure={0}; RTC_DateType RTC_DateStructure={0};
RTC_TimeType RTC_TimeStructure={0}; RTC_TimeType RTC_TimeStructure={0};
@ -94,7 +94,7 @@ static rt_err_t set_rtc_time_stamp(time_t time_stamp)
rt_kprintf("set rtc time.\n"); rt_kprintf("set rtc time.\n");
return RT_EOK; return RT_EOK;
} }
static rt_err_t rt_rtc_config(void) static rt_err_t rt_rtc_config(void)

View File

@ -319,8 +319,8 @@ int rt_hw_spi_init(void)
result = rt_spi_bus_register(&spi_bus3, "spi3", &spi_ops); result = rt_spi_bus_register(&spi_bus3, "spi3", &spi_ops);
/* Enable AFIO clock */ /* Enable AFIO clock */
RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_AFIO, ENABLE); RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_AFIO, ENABLE);
GPIO_ConfigPinRemap(GPIO_RMP_SW_JTAG_SW_ENABLE, ENABLE); GPIO_ConfigPinRemap(GPIO_RMP_SW_JTAG_SW_ENABLE, ENABLE);
RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_SPI3, ENABLE); RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_SPI3, ENABLE);