Skip to content

Commit 76431f6

Browse files
committed
Merge remote-tracking branch 'remotes/origin/master' into master_lab
2 parents 9604516 + 9f7cc78 commit 76431f6

File tree

101 files changed

+2717
-1331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2717
-1331
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ RT-Thread RTOS like a traditional real-time operating system. The kernel has rea
1717

1818
* Device Driver;
1919
* Component;
20-
* Dyanmic Module
20+
* Dynamic Module
2121

2222
The device driver is more like a driver framework, UART, IIC, SPI, SDIO, USB device/host, EMAC, MTD NAND etc. The developer can easily add low level driver and board configuration, then combined with the upper framework, he/she can use lots of features.
2323

2424
The Component is a software concept upon RT-Thread kernel, for example a shell (finsh/msh shell), virtual file system (FAT, YAFFS, UFFS, ROM/RAM file system etc), TCP/IP protocol stack (lwIP), POSIX (thread) interface etc. One component must be a directory under RT-Thread/Components and one component can be descripted by a SConscript file (then be compiled and linked into the system).
2525

26-
The Dyanmic Module, formerly named as User Applicaion (UA) is a dyanmic loaded module or library, it can be compiled standalone without Kernel. Each Dyanmic Module has its own object list to manage thread/semaphore/kernel object which was created or initialized inside this UA. More information about UA, please visit another [git repo](https://github.com/RT-Thread/rtthread-apps).
26+
The Dynamic Module, formerly named as User Applicaion (UA) is a dynamic loaded module or library, it can be compiled standalone without Kernel. Each Dynamic Module has its own object list to manage thread/semaphore/kernel object which was created or initialized inside this UA. More information about UA, please visit another [git repo](https://github.com/RT-Thread/rtthread-apps).
2727

2828
## Board Support Package ##
2929

bsp/es32f0334/drivers/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ES32F0_SRAM_SIZE 0x8000
1818
#define ES32F0_SRAM_END (0x20000000 + ES32F0_SRAM_SIZE)
1919

20-
#ifdef __CC_ARM
20+
#if defined(__CC_ARM) || defined(__CLANG_ARM)
2121
extern int Image$$RW_IRAM1$$ZI$$Limit;
2222
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
2323
#elif __ICCARM__

bsp/es32f0334/drivers/drv_pm.c

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2019-04-08 wangyq the first version
9+
* 2019-05-06 Zero-Free adapt to the new power management interface
910
*/
1011

1112
#include <rthw.h>
@@ -16,52 +17,26 @@
1617

1718
#ifdef RT_USING_PM
1819

19-
static void _drv_pm_enter(struct rt_pm *pm)
20+
static void _drv_pm_enter(struct rt_pm *pm, uint8_t mode)
2021
{
21-
rt_uint32_t mode;
22-
23-
mode = pm->current_mode;
24-
2522
switch (mode)
2623
{
27-
case PM_RUN_MODE_NORMAL:
24+
case PM_SLEEP_MODE_NONE:
2825
break;
2926

30-
case PM_SLEEP_MODE_SLEEP:
27+
case PM_SLEEP_MODE_IDLE:
3128
__WFI();
3229
break;
3330

34-
case PM_SLEEP_MODE_TIMER:
35-
pmu_stop2_enter();
36-
break;
37-
38-
case PM_SLEEP_MODE_SHUTDOWN:
39-
pmu_standby_enter(PMU_STANDBY_PORT_NONE);
40-
break;
41-
42-
default:
43-
RT_ASSERT(0);
44-
break;
45-
}
46-
}
47-
48-
static void _drv_pm_exit(struct rt_pm *pm)
49-
{
50-
rt_uint32_t mode;
51-
52-
RT_ASSERT(pm != RT_NULL);
53-
54-
mode = pm->current_mode;
55-
56-
switch (mode)
57-
{
58-
case PM_RUN_MODE_NORMAL:
31+
case PM_SLEEP_MODE_LIGHT:
5932
break;
6033

61-
case PM_SLEEP_MODE_SLEEP:
34+
case PM_SLEEP_MODE_DEEP:
35+
pmu_stop2_enter();
6236
break;
6337

64-
case PM_SLEEP_MODE_TIMER:
38+
case PM_SLEEP_MODE_STANDBY:
39+
pmu_standby_enter(PMU_STANDBY_PORT_NONE);
6540
break;
6641

6742
case PM_SLEEP_MODE_SHUTDOWN:
@@ -73,32 +48,21 @@ static void _drv_pm_exit(struct rt_pm *pm)
7348
}
7449
}
7550

76-
#if PM_RUN_MODE_COUNT > 1
77-
static void _drv_pm_frequency_change(struct rt_pm *pm, rt_uint32_t frequency)
78-
{
79-
return;
80-
}
81-
#endif
82-
8351
static int drv_hw_pm_init(void)
8452
{
8553
static const struct rt_pm_ops _ops =
8654
{
8755
_drv_pm_enter,
88-
_drv_pm_exit,
89-
90-
#if PM_RUN_MODE_COUNT > 1
91-
_drv_pm_frequency_change,
92-
#endif
56+
RT_NULL,
9357
RT_NULL,
9458
RT_NULL,
9559
RT_NULL
9660
};
9761

98-
rt_uint8_t timer_mask;
62+
rt_uint8_t timer_mask = 0;
9963

100-
/* initialize timer mask */
101-
timer_mask = 1UL << PM_SLEEP_MODE_TIMER;
64+
/* initialize timer mask(no need tickless) */
65+
// timer_mask = 1UL << PM_SLEEP_MODE_DEEP;
10266

10367
/* initialize system pm module */
10468
rt_system_pm_init(&_ops, timer_mask, RT_NULL);

bsp/es32f0654/drivers/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ES32F0_SRAM_SIZE 0x8000
1818
#define ES32F0_SRAM_END (0x20000000 + ES32F0_SRAM_SIZE)
1919

20-
#ifdef __CC_ARM
20+
#if defined(__CC_ARM) || defined(__CLANG_ARM)
2121
extern int Image$$RW_IRAM1$$ZI$$Limit;
2222
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
2323
#elif __ICCARM__

bsp/es32f0654/drivers/drv_pm.c

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2019-04-01 wangyq the first version
9+
* 2019-05-06 Zero-Free adapt to the new power management interface
910
*/
1011

1112
#include <rthw.h>
@@ -16,52 +17,26 @@
1617

1718
#ifdef RT_USING_PM
1819

19-
static void _drv_pm_enter(struct rt_pm *pm)
20+
static void _drv_pm_enter(struct rt_pm *pm, uint8_t mode)
2021
{
21-
rt_uint32_t mode;
22-
23-
mode = pm->current_mode;
24-
2522
switch (mode)
2623
{
27-
case PM_RUN_MODE_NORMAL:
24+
case PM_SLEEP_MODE_NONE:
2825
break;
2926

30-
case PM_SLEEP_MODE_SLEEP:
27+
case PM_SLEEP_MODE_IDLE:
3128
__WFI();
3229
break;
3330

34-
case PM_SLEEP_MODE_TIMER:
35-
pmu_stop2_enter();
36-
break;
37-
38-
case PM_SLEEP_MODE_SHUTDOWN:
39-
pmu_standby_enter(PMU_STANDBY_PORT_NONE);
40-
break;
41-
42-
default:
43-
RT_ASSERT(0);
44-
break;
45-
}
46-
}
47-
48-
static void _drv_pm_exit(struct rt_pm *pm)
49-
{
50-
rt_uint32_t mode;
51-
52-
RT_ASSERT(pm != RT_NULL);
53-
54-
mode = pm->current_mode;
55-
56-
switch (mode)
57-
{
58-
case PM_RUN_MODE_NORMAL:
31+
case PM_SLEEP_MODE_LIGHT:
5932
break;
6033

61-
case PM_SLEEP_MODE_SLEEP:
34+
case PM_SLEEP_MODE_DEEP:
35+
pmu_stop2_enter();
6236
break;
6337

64-
case PM_SLEEP_MODE_TIMER:
38+
case PM_SLEEP_MODE_STANDBY:
39+
pmu_standby_enter(PMU_STANDBY_PORT_NONE);
6540
break;
6641

6742
case PM_SLEEP_MODE_SHUTDOWN:
@@ -73,32 +48,21 @@ static void _drv_pm_exit(struct rt_pm *pm)
7348
}
7449
}
7550

76-
#if PM_RUN_MODE_COUNT > 1
77-
static void _drv_pm_frequency_change(struct rt_pm *pm, rt_uint32_t frequency)
78-
{
79-
return;
80-
}
81-
#endif
82-
8351
static int drv_hw_pm_init(void)
8452
{
8553
static const struct rt_pm_ops _ops =
8654
{
8755
_drv_pm_enter,
88-
_drv_pm_exit,
89-
90-
#if PM_RUN_MODE_COUNT > 1
91-
_drv_pm_frequency_change,
92-
#endif
56+
RT_NULL,
9357
RT_NULL,
9458
RT_NULL,
9559
RT_NULL
9660
};
9761

98-
rt_uint8_t timer_mask;
62+
rt_uint8_t timer_mask = 0;
9963

100-
/* initialize timer mask */
101-
timer_mask = 1UL << PM_SLEEP_MODE_TIMER;
64+
/* initialize timer mask(no need tickless) */
65+
timer_mask = 1UL << PM_SLEEP_MODE_DEEP;
10266

10367
/* initialize system pm module */
10468
rt_system_pm_init(&_ops, timer_mask, RT_NULL);

bsp/gd32e230k-start/drivers/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern char __ICFEDIT_region_RAM_end__;
2525
#define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
2626
#endif
2727

28-
#ifdef __ARMCC_VERSION
28+
#if defined(__CC_ARM) || defined(__CLANG_ARM)
2929
extern int Image$$RW_IRAM1$$ZI$$Limit;
3030
#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
3131
#elif __ICCARM__

0 commit comments

Comments
 (0)