1. optimize plc relative codes
2. fixed ShowChannel exception 3. optimize RTC codes 4. compatible memory lds with USB
This commit is contained in:
@@ -23,6 +23,7 @@ Author: AIIT XUOS Lab
|
||||
Modification:
|
||||
1. support imxrt1052-board MPU、clock、memory init
|
||||
2. support imxrt1052-board uart、semc、sdio driver init
|
||||
3. support imxrt1052-board I2C, SPI, ADC, RTC driver init
|
||||
*************************************************/
|
||||
|
||||
#include "fsl_common.h"
|
||||
@@ -67,6 +68,9 @@ int MountSDCard(void)
|
||||
|
||||
#include <connect_ethernet.h>
|
||||
#include <connect_uart.h>
|
||||
#include <connect_adc.h>
|
||||
#include <connect_spi.h>
|
||||
#include <connect_rtc.h>
|
||||
|
||||
#define NVIC_PRIORITYGROUP_0 0x00000007U /*!< 0 bits for pre-emption priority
|
||||
4 bits for subpriority */
|
||||
@@ -660,6 +664,18 @@ void InitBoardHardware()
|
||||
Imrt1052HwUartInit();
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_ADC
|
||||
Imrt1052HwAdcInit();
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_SPI
|
||||
Imrt1052HwSpiInit();
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_RTC
|
||||
Imrt1052HwRtcInit();
|
||||
#endif
|
||||
|
||||
InstallConsole(KERNEL_CONSOLE_BUS_NAME, KERNEL_CONSOLE_DRV_NAME, KERNEL_CONSOLE_DEVICE_NAME);
|
||||
|
||||
#ifdef BSP_USING_SDIO
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
||||
|
||||
export CFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb
|
||||
export CFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb
|
||||
export AFLAGS := -c -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb -gdwarf-2
|
||||
|
||||
### if use USB function, use special lds file because USB uses ITCM
|
||||
|
||||
ifeq ($(CONFIG_BSP_USING_USB),y)
|
||||
export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_ok1052-c.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-usb.lds
|
||||
else
|
||||
export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_ok1052-c.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
endif
|
||||
|
||||
export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
Executable
+250
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1052CVJ5B
|
||||
** MIMXRT1052CVL5B
|
||||
** MIMXRT1052DVJ6B
|
||||
** MIMXRT1052DVL6B
|
||||
**
|
||||
** Compiler: GNU C Compiler
|
||||
** Reference manual: IMXRT1050RM Rev.1, 03/2018
|
||||
** Version: rev. 1.0, 2018-09-21
|
||||
** Build: b180921
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the GNU C Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2018 NXP
|
||||
** All rights reserved.
|
||||
**
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file link.lds
|
||||
* @brief ok1052-c Linker script
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2021-05-28
|
||||
*/
|
||||
|
||||
/*************************************************
|
||||
File name: link.lds
|
||||
Description: ok1052-c Linker script
|
||||
Others: take MIMXRT1052xxxxx_flexspi_nor.ld for references
|
||||
History:
|
||||
1. Date: 2021-05-28
|
||||
Author: AIIT XUOS Lab
|
||||
Modification:
|
||||
1. add shell cmd table and g_service_table
|
||||
*************************************************/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
|
||||
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400
|
||||
m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x03FFDC00
|
||||
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
|
||||
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
||||
}
|
||||
|
||||
/* Define output sections */
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
/* The startup code goes first into internal RAM */
|
||||
.interrupts :
|
||||
{
|
||||
__VECTOR_TABLE = .;
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} > m_interrupts
|
||||
|
||||
__VECTOR_RAM = __VECTOR_TABLE;
|
||||
__RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
|
||||
|
||||
/* The program code and other data goes into internal RAM */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
*(.glue_7) /* glue arm to thumb code */
|
||||
*(.glue_7t) /* glue thumb to arm code */
|
||||
*(.eh_frame)
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
. = ALIGN(4);
|
||||
|
||||
|
||||
/* section information for shell */
|
||||
. = ALIGN(4);
|
||||
_shell_command_start = .;
|
||||
KEEP (*(shellCommand))
|
||||
_shell_command_end = .;
|
||||
. = ALIGN(4);
|
||||
|
||||
__isrtbl_idx_start = .;
|
||||
KEEP(*(.isrtbl.idx))
|
||||
__isrtbl_start = .;
|
||||
KEEP(*(.isrtbl))
|
||||
__isrtbl_end = .;
|
||||
. = ALIGN(4);
|
||||
|
||||
PROVIDE(g_service_table_start = ABSOLUTE(.));
|
||||
KEEP(*(.g_service_table))
|
||||
PROVIDE(g_service_table_end = ABSOLUTE(.));
|
||||
} > m_text
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > m_text
|
||||
|
||||
.ARM :
|
||||
{
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} > m_text
|
||||
|
||||
.ctors :
|
||||
{
|
||||
__CTOR_LIST__ = .;
|
||||
/* gcc uses crtbegin.o to find the start of
|
||||
the constructors, so we make sure it is
|
||||
first. Because this is a wildcard, it
|
||||
doesn't matter if the user does not
|
||||
actually link against crtbegin.o; the
|
||||
linker won't look for a file to match a
|
||||
wildcard. The wildcard also means that it
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*crtbegin?.o(.ctors))
|
||||
/* We don't want to include the .ctor section from
|
||||
from the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__CTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.dtors :
|
||||
{
|
||||
__DTOR_LIST__ = .;
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*crtbegin?.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__DTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array*))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} > m_text
|
||||
|
||||
__etext = .; /* define a global symbol at end of code */
|
||||
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
|
||||
|
||||
.data : AT(__DATA_ROM)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__DATA_RAM = .;
|
||||
__data_start__ = .; /* create a global symbol at data start */
|
||||
*(m_usb_dma_init_data)
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
__data_end__ = .; /* define a global symbol at data end */
|
||||
} > m_data
|
||||
|
||||
__NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__);
|
||||
.ncache.init : AT(__NDATA_ROM)
|
||||
{
|
||||
__noncachedata_start__ = .; /* create a global symbol at ncache data start */
|
||||
*(NonCacheable.init)
|
||||
. = ALIGN(4);
|
||||
__noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */
|
||||
} > m_data
|
||||
. = __noncachedata_init_end__;
|
||||
.ncache :
|
||||
{
|
||||
*(NonCacheable)
|
||||
. = ALIGN(4);
|
||||
__noncachedata_end__ = .; /* define a global symbol at ncache data end */
|
||||
} > m_data
|
||||
|
||||
__DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__);
|
||||
text_end = ORIGIN(m_text) + LENGTH(m_text);
|
||||
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
|
||||
|
||||
/* Uninitialized data section */
|
||||
.bss :
|
||||
{
|
||||
/* This is used by the startup in order to initialize the .bss section */
|
||||
. = ALIGN(4);
|
||||
__START_BSS = .;
|
||||
__bss_start__ = .;
|
||||
*(m_usb_dma_noninit_data)
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
__END_BSS = .;
|
||||
} > m_data
|
||||
|
||||
.stack :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
stack_start = .;
|
||||
. += STACK_SIZE;
|
||||
stack_end = .;
|
||||
__StackTop = .;
|
||||
heap_start = .;
|
||||
} > m_data
|
||||
|
||||
PROVIDE(heap_end = ORIGIN(m_data) + LENGTH(m_data));
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
}
|
||||
|
||||
@@ -241,9 +241,9 @@ SECTIONS
|
||||
stack_end = .;
|
||||
__StackTop = .;
|
||||
heap_start = .;
|
||||
} > m_data
|
||||
} > m_data2
|
||||
|
||||
PROVIDE(heap_end = ORIGIN(m_data) + LENGTH(m_data));
|
||||
PROVIDE(heap_end = ORIGIN(m_data2) + LENGTH(m_data2));
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@ void RtcI2cInit(void);
|
||||
status_t RtcI2cWrite(LPI2C_Type *base, uint32_t sub_addr, uint8_t *buf, uint16_t size);
|
||||
uint32_t RtcI2cRead(LPI2C_Type *base, uint32_t sub_addr, uint8_t *buf, uint16_t size);
|
||||
|
||||
int RtcSetTime(uint8_t* asc_date);
|
||||
int RtcGetTime(void);
|
||||
int Imrt1052HwRtcInit(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -52,16 +52,19 @@ Modification:
|
||||
*************************************************/
|
||||
|
||||
#include "board.h"
|
||||
#include "bus_rtc.h"
|
||||
#include "pin_mux.h"
|
||||
#include "dev_rtc.h"
|
||||
#include "connect_rtc.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* Definitions
|
||||
******************************************************************************/
|
||||
#define EXAMPLE_DELAY_COUNT 8000000
|
||||
|
||||
#define rtc_print KPrintf
|
||||
|
||||
#define MAX_TIME_STR_SIZE 50
|
||||
|
||||
///////////RX8010///////////
|
||||
|
||||
#define RX8010_SEC 0x10
|
||||
@@ -246,50 +249,201 @@ int RtcSetTime(uint8_t* asc_date)
|
||||
}
|
||||
|
||||
// get rx8010 time
|
||||
int RtcGetTime(void)
|
||||
int RtcGetTime(struct tm *ct)
|
||||
{
|
||||
uint8_t date[7];
|
||||
uint8_t dateRsul[7];
|
||||
uint8_t flagreg;
|
||||
uint8_t rtc_data[7];
|
||||
uint8_t time_str[7];
|
||||
uint8_t flag_reg;
|
||||
int err;
|
||||
err = RtcI2cRead(I2C_RTC_BASE, RX8010_FLAG, &flagreg, 1);
|
||||
err = RtcI2cRead(I2C_RTC_BASE, RX8010_FLAG, &flag_reg, 1);
|
||||
|
||||
if(flagreg & RX8010_FLAG_VLF)
|
||||
if(flag_reg & RX8010_FLAG_VLF)
|
||||
{
|
||||
rtc_print("\r\n Frequency stop was detected\r\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
err = RtcI2cRead(I2C_RTC_BASE, RX8010_SEC, date, 7);
|
||||
dateRsul[0] = bcd2bin(date[RX8010_SEC - RX8010_SEC] & 0x7f);
|
||||
dateRsul[1] = bcd2bin(date[RX8010_MIN - RX8010_SEC] & 0x7f);
|
||||
dateRsul[2] = bcd2bin(date[RX8010_HOUR - RX8010_SEC] & 0x3f);
|
||||
dateRsul[4] = bcd2bin(date[RX8010_MDAY - RX8010_SEC] & 0x3f);
|
||||
dateRsul[5] = bcd2bin(date[RX8010_MONTH - RX8010_SEC] & 0x1f);
|
||||
dateRsul[6] = bcd2bin(date[RX8010_YEAR - RX8010_SEC]);
|
||||
dateRsul[3] = date[RX8010_WDAY - RX8010_SEC] & 0x7f;
|
||||
err = RtcI2cRead(I2C_RTC_BASE, RX8010_SEC, rtc_data, 7);
|
||||
time_str[0] = bcd2bin(rtc_data[RX8010_SEC - RX8010_SEC] & 0x7f);
|
||||
time_str[1] = bcd2bin(rtc_data[RX8010_MIN - RX8010_SEC] & 0x7f);
|
||||
time_str[2] = bcd2bin(rtc_data[RX8010_HOUR - RX8010_SEC] & 0x3f);
|
||||
time_str[4] = bcd2bin(rtc_data[RX8010_MDAY - RX8010_SEC] & 0x3f);
|
||||
time_str[5] = bcd2bin(rtc_data[RX8010_MONTH - RX8010_SEC] & 0x1f);
|
||||
time_str[6] = bcd2bin(rtc_data[RX8010_YEAR - RX8010_SEC]);
|
||||
time_str[3] = rtc_data[RX8010_WDAY - RX8010_SEC] & 0x7f;
|
||||
|
||||
rtc_print("RX8010 Time: 20%d%d-%d%d-%d%d %d%d:%d%d:%d%d\r\n",
|
||||
dateRsul[6]/10, dateRsul[6]%10, dateRsul[5]/10, dateRsul[5]%10, dateRsul[4]/10, dateRsul[4]%10,
|
||||
dateRsul[2]/10, dateRsul[2]%10, dateRsul[1]/10, dateRsul[1]%10, dateRsul[0]/10, dateRsul[0]%10);
|
||||
time_str[6]/10, time_str[6]%10, time_str[5]/10, time_str[5]%10, time_str[4]/10, time_str[4]%10,
|
||||
time_str[2]/10, time_str[2]%10, time_str[1]/10, time_str[1]%10, time_str[0]/10, time_str[0]%10);
|
||||
|
||||
ct->tm_year = time_str[6];
|
||||
ct->tm_mon = time_str[5];
|
||||
ct->tm_mday = time_str[4];
|
||||
ct->tm_wday = time_str[3];
|
||||
ct->tm_hour = time_str[2];
|
||||
ct->tm_min = time_str[1];
|
||||
ct->tm_sec = time_str[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RtcTestRx8010(int argc, char* argv[])
|
||||
static int GetWeekDay(int year, int month, int day)
|
||||
{
|
||||
if(month==1||month==2)
|
||||
{
|
||||
year -=1;
|
||||
month +=12;
|
||||
}
|
||||
|
||||
return (day+1+2*month+3*(month+1)/5+year+(year/4)-year/100+year/400)%7+1;
|
||||
}
|
||||
|
||||
static uint32 RtcConfigure(void* drv, struct BusConfigureInfo* configure_info)
|
||||
{
|
||||
NULL_PARAM_CHECK(drv);
|
||||
struct RtcDriver* rtc_drv = (struct RtcDriver*)drv;
|
||||
struct RtcDrvConfigureParam* drv_param = (struct RtcDrvConfigureParam*)configure_info->private_data;
|
||||
int cmd = drv_param->rtc_operation_cmd;
|
||||
time_t* time = drv_param->time;
|
||||
|
||||
switch(cmd)
|
||||
{
|
||||
case OPER_RTC_GET_TIME:
|
||||
{
|
||||
struct tm ct;
|
||||
RtcGetTime(&ct);
|
||||
*time = mktime(&ct);
|
||||
}
|
||||
break;
|
||||
|
||||
case OPER_RTC_SET_TIME:
|
||||
{
|
||||
char time_str[MAX_TIME_STR_SIZE] = {0};
|
||||
struct tm *ct = localtime(time);
|
||||
strftime(time_str, MAX_TIME_STR_SIZE, "%y-%m-%d %H:%M:%S", ct);
|
||||
RtcSetTime(time_str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return EOK;
|
||||
}
|
||||
|
||||
int RtcConfiguration(void)
|
||||
{
|
||||
BOARD_InitI2C1Pins();
|
||||
RtcI2cInit();
|
||||
RtcInit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*manage the rtc device operations*/
|
||||
static const struct RtcDevDone dev_done =
|
||||
{
|
||||
.open = NONE,
|
||||
.close = NONE,
|
||||
.write = NONE,
|
||||
.read = NONE,
|
||||
};
|
||||
|
||||
static int BoardRtcBusInit(struct RtcBus* rtc_bus, struct RtcDriver* rtc_driver)
|
||||
{
|
||||
x_err_t ret = EOK;
|
||||
/*Init the rtc bus */
|
||||
ret = RtcBusInit(rtc_bus, RTC_BUS_NAME);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init RtcBusInit error %d\n", ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/*Init the rtc driver*/
|
||||
ret = RtcDriverInit(rtc_driver, RTC_DRV_NAME);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init RtcDriverInit error %d\n", ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/*Attach the rtc driver to the rtc bus*/
|
||||
ret = RtcDriverAttachToBus(RTC_DRV_NAME, RTC_BUS_NAME);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init RtcDriverAttachToBus error %d\n", ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*Attach the rtc device to the rtc bus*/
|
||||
static int BoardRtcDevBend(void)
|
||||
{
|
||||
x_err_t ret = EOK;
|
||||
static struct RtcHardwareDevice rtc_device;
|
||||
memset(&rtc_device, 0, sizeof(struct RtcHardwareDevice));
|
||||
rtc_device.dev_done = &(dev_done);
|
||||
ret = RtcDeviceRegister(&rtc_device, NONE, RTC_DEVICE_NAME);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init RtcDeviceInit device %s error %d\n", RTC_DEVICE_NAME, ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
ret = RtcDeviceAttachToBus(RTC_DEVICE_NAME, RTC_BUS_NAME);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init RtcDeviceAttachToBus device %s error %d\n", RTC_DEVICE_NAME, ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int Imrt1052HwRtcInit(void)
|
||||
{
|
||||
x_err_t ret = EOK;
|
||||
static struct RtcBus rtc_bus;
|
||||
memset(&rtc_bus, 0, sizeof(struct RtcBus));
|
||||
static struct RtcDriver rtc_driver;
|
||||
memset(&rtc_driver, 0, sizeof(struct RtcDriver));
|
||||
rtc_driver.configure = &(RtcConfigure);
|
||||
ret = BoardRtcBusInit(&rtc_bus, &rtc_driver);
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init error ret %u\n", ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
ret = BoardRtcDevBend();
|
||||
|
||||
if(EOK != ret)
|
||||
{
|
||||
KPrintf("hw_rtc_init error ret %u\n", ret);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
RtcConfiguration();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RtcTestRx8010(int argc, char* argv[])
|
||||
{
|
||||
if(argc == 2)
|
||||
{
|
||||
if(RtcSetTime(argv[1]) == 0)
|
||||
{
|
||||
RtcGetTime();
|
||||
RtcGetTime(NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RtcGetTime();
|
||||
RtcGetTime(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@ if TOOL_SHELL
|
||||
bool
|
||||
config SHELL_ENTER_LF
|
||||
bool
|
||||
|
||||
|
||||
choice
|
||||
prompt "Set shell end-of-line markers :"
|
||||
default SHELL_ENTER_CR_AND_LF
|
||||
|
||||
|
||||
config SHELL_ENTER_CR_AND_LF
|
||||
bool "Using CR And LF as end-of-line markers"
|
||||
select SHELL_ENTER_CR
|
||||
select SHELL_ENTER_LF
|
||||
|
||||
select SHELL_ENTER_LF
|
||||
|
||||
config SHELL_ENTER_CRLF
|
||||
bool "Using CRLF as end-of-line markers"
|
||||
endchoice
|
||||
@@ -27,7 +27,7 @@ if TOOL_SHELL
|
||||
config SHELL_DEFAULT_USER
|
||||
string "Set default user's name"
|
||||
default "letter"
|
||||
|
||||
|
||||
config SHELL_DEFAULT_USER_PASSWORD
|
||||
string "Set default user's password(none for unnecessary)"
|
||||
default ""
|
||||
@@ -41,13 +41,13 @@ if TOOL_SHELL
|
||||
config SHELL_TASK_STACK_SIZE
|
||||
int "Set the stack size for shell "
|
||||
default 4096
|
||||
|
||||
|
||||
config SHELL_TASK_PRIORITY
|
||||
int
|
||||
default 5 if KTASK_PRIORITY_8
|
||||
default 20 if KTASK_PRIORITY_32
|
||||
default 120 if KTASK_PRIORITY_256
|
||||
|
||||
|
||||
config SHELL_MAX_NUMBER
|
||||
int "Set the max shell count"
|
||||
default 5
|
||||
@@ -57,7 +57,7 @@ if TOOL_SHELL
|
||||
default 8
|
||||
help
|
||||
The max number of parameter in shell. We support up to eight including command name.
|
||||
|
||||
|
||||
config SHELL_HISTORY_MAX_NUMBER
|
||||
int "Set the max number of command history"
|
||||
default 5
|
||||
|
||||
Reference in New Issue
Block a user