[nrf5x] auto formatted

This commit is contained in:
Meco Man 2021-03-14 15:18:33 +08:00
parent c3ffe18688
commit 347916a755
28 changed files with 235 additions and 235 deletions

View File

@ -14,9 +14,9 @@
// <o> Internal SRAM memory size[Kbytes] <16 or 32>
// <i>Default: 16
#define NRF_SRAM_BEGIN (0x20000000)
#define NRF_SRAM_SIZE (16 * 1024)
#define NRF_SRAM_END (NRF_SRAM_BEGIN + NRF_SRAM_SIZE)
#define NRF_SRAM_BEGIN (0x20000000)
#define NRF_SRAM_SIZE (16 * 1024)
#define NRF_SRAM_END (NRF_SRAM_BEGIN + NRF_SRAM_SIZE)
//#endif

View File

@ -189,10 +189,10 @@ void rt_hw_uart_init(void)
rt_ringbuffer_init(&(uart->rx_rb), rx_buffer, sizeof(rx_buffer));
/* device interface */
uart->parent.init = rt_uart_init;
uart->parent.open = rt_uart_open;
uart->parent.init = rt_uart_init;
uart->parent.open = rt_uart_open;
uart->parent.close = rt_uart_close;
uart->parent.read = rt_uart_read;
uart->parent.read = rt_uart_read;
uart->parent.write = rt_uart_write;
uart->parent.control = RT_NULL;
uart->parent.user_data = RT_NULL;

View File

@ -3,16 +3,16 @@
#define __RTTHREAD_CFG_H__
/* RT_NAME_MAX*/
#define RT_NAME_MAX 6
#define RT_NAME_MAX 6
/* RT_ALIGN_SIZE*/
#define RT_ALIGN_SIZE 4
#define RT_ALIGN_SIZE 4
/* PRIORITY_MAX */
#define RT_THREAD_PRIORITY_MAX 8
#define RT_THREAD_PRIORITY_MAX 8
/* Tick per Second */
#define RT_TICK_PER_SECOND 100
#define RT_TICK_PER_SECOND 100
/* SECTION: RT_DEBUG */
/* Thread Debug */
@ -24,13 +24,13 @@
/* Using Hook */
#define RT_USING_HOOK
#define IDLE_THREAD_STACK_SIZE 512
#define IDLE_THREAD_STACK_SIZE 512
/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 512
#define RT_TIMER_TICK_PER_SECOND 100
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 512
#define RT_TIMER_TICK_PER_SECOND 100
/* SECTION: IPC */
/* Using Semaphore*/
@ -74,9 +74,9 @@
/* SECTION: Console options */
#define RT_USING_CONSOLE
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLEBUF_SIZE 128
// <string name="RT_CONSOLE_DEVICE_NAME" description="The device name for console" default="uart1" />
#define RT_CONSOLE_DEVICE_NAME "uart0"
#define RT_CONSOLE_DEVICE_NAME "uart0"
@ -84,8 +84,8 @@
#define RT_USING_FINSH
/* configure finsh parameters */
#define FINSH_THREAD_PRIORITY 6
#define FINSH_THREAD_STACK_SIZE 512
#define FINSH_HISTORY_LINES 1
#define FINSH_THREAD_STACK_SIZE 512
#define FINSH_HISTORY_LINES 1
/* Using symbol table */
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -389,90 +389,90 @@ INIT_BOARD_EXPORT(rt_hw_pin_init);
void button_1_callback(void *args)
{
static int flag1 = 0;
if(flag1 == 0)
{
flag1 = 1;
rt_pin_write(DK_BOARD_LED_1, PIN_LOW);
}
else
{
flag1 = 0;
rt_pin_write(DK_BOARD_LED_1, PIN_HIGH);
}
static int flag1 = 0;
if(flag1 == 0)
{
flag1 = 1;
rt_pin_write(DK_BOARD_LED_1, PIN_LOW);
}
else
{
flag1 = 0;
rt_pin_write(DK_BOARD_LED_1, PIN_HIGH);
}
}
void button_2_callback(void *args)
{
static int flag2 = 0;
if(flag2 == 0)
{
flag2 = 1;
rt_pin_write(DK_BOARD_LED_2, PIN_LOW);
}
else
{
flag2 = 0;
rt_pin_write(DK_BOARD_LED_2, PIN_HIGH);
}
static int flag2 = 0;
if(flag2 == 0)
{
flag2 = 1;
rt_pin_write(DK_BOARD_LED_2, PIN_LOW);
}
else
{
flag2 = 0;
rt_pin_write(DK_BOARD_LED_2, PIN_HIGH);
}
}
void button_3_callback(void *args)
{
static int flag3 = 0;
if(flag3 == 0)
{
flag3 = 1;
rt_pin_write(DK_BOARD_LED_3, PIN_LOW);
}
else
{
flag3 = 0;
rt_pin_write(DK_BOARD_LED_3, PIN_HIGH);
}
static int flag3 = 0;
if(flag3 == 0)
{
flag3 = 1;
rt_pin_write(DK_BOARD_LED_3, PIN_LOW);
}
else
{
flag3 = 0;
rt_pin_write(DK_BOARD_LED_3, PIN_HIGH);
}
}
void button_4_callback(void *args)
{
static int flag4 = 0;
if(flag4 == 0)
{
flag4 = 1;
rt_pin_write(DK_BOARD_LED_4, PIN_LOW);
}
else
{
flag4 = 0;
rt_pin_write(DK_BOARD_LED_4, PIN_HIGH);
}
static int flag4 = 0;
if(flag4 == 0)
{
flag4 = 1;
rt_pin_write(DK_BOARD_LED_4, PIN_LOW);
}
else
{
flag4 = 0;
rt_pin_write(DK_BOARD_LED_4, PIN_HIGH);
}
}
void gpio_sample(void)
{
rt_err_t err_code;
rt_err_t err_code;
rt_pin_mode(DK_BOARD_LED_1, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_2, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_3, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_4, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_1, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_2, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_3, PIN_MODE_OUTPUT);
rt_pin_mode(DK_BOARD_LED_4, PIN_MODE_OUTPUT);
rt_pin_write(DK_BOARD_LED_1, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_2, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_3, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_4, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_1, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_2, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_3, PIN_HIGH);
rt_pin_write(DK_BOARD_LED_4, PIN_HIGH);
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_1, PIN_IRQ_MODE_FALLING,
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_1, PIN_IRQ_MODE_FALLING,
button_1_callback, (void*) true); //true: hi_accuracy(IN_EVENT),false: lo_accuracy(PORT_EVENT)
rt_pin_irq_enable(DK_BOARD_BUTTON_1, PIN_IRQ_ENABLE);
rt_pin_irq_enable(DK_BOARD_BUTTON_1, PIN_IRQ_ENABLE);
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_2, PIN_IRQ_MODE_FALLING,
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_2, PIN_IRQ_MODE_FALLING,
button_2_callback, (void*) true); //true: hi_accuracy(IN_EVENT),false: lo_accuracy(PORT_EVENT)
rt_pin_irq_enable(DK_BOARD_BUTTON_2, PIN_IRQ_ENABLE);
rt_pin_irq_enable(DK_BOARD_BUTTON_2, PIN_IRQ_ENABLE);
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_3, PIN_IRQ_MODE_FALLING,
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_3, PIN_IRQ_MODE_FALLING,
button_3_callback, (void*) true); //true: hi_accuracy(IN_EVENT),false: lo_accuracy(PORT_EVENT)
rt_pin_irq_enable(DK_BOARD_BUTTON_3, PIN_IRQ_ENABLE);
rt_pin_irq_enable(DK_BOARD_BUTTON_3, PIN_IRQ_ENABLE);
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_4, PIN_IRQ_MODE_FALLING,
err_code = rt_pin_attach_irq(DK_BOARD_BUTTON_4, PIN_IRQ_MODE_FALLING,
button_4_callback, (void*) false); //true: hi_accuracy(IN_EVENT),false: lo_accuracy(PORT_EVENT)
rt_pin_irq_enable(DK_BOARD_BUTTON_4, PIN_IRQ_ENABLE);
rt_pin_irq_enable(DK_BOARD_BUTTON_4, PIN_IRQ_ENABLE);
}
MSH_CMD_EXPORT(gpio_sample, gpio sample);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -64,7 +64,7 @@ void OSTick_Handler( void )
{
uint32_t diff;
/* enter interrupt */
/* enter interrupt */
rt_interrupt_enter();
diff = _tick_distance();
@ -92,7 +92,7 @@ static void _wakeup_tick_adjust(void)
if (rt_thread_self() != RT_NULL)
{
struct rt_thread *thread;
struct rt_thread *thread;
/* check time slice */
thread = rt_thread_self();

View File

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

View File

@ -1,4 +1,4 @@
#ifndef APP_CONFIG_H
#define APP_CONFIG_H
#endif //APP_CONFIG_H
#endif //APP_CONFIG_H

View File

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

View File

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

View File

@ -1,4 +1,4 @@
#ifndef APP_CONFIG_H
#define APP_CONFIG_H
#endif //APP_CONFIG_H
#endif //APP_CONFIG_H

View File

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

View File

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