Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/drivers/misc/SConscript
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from building import *

cwd = GetCurrentDir()
Expand Down Expand Up @@ -29,4 +30,9 @@ if GetDepend(['RT_USING_RANDOM']):
if len(src):
group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)

list = os.listdir(cwd)
for item in list:
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
group = group + SConscript(os.path.join(item, 'SConscript'))

Return('group')
39 changes: 39 additions & 0 deletions components/drivers/misc/utest/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
menu "PWM Test"

config RT_UTEST_PWM
bool "PWM Frequency and Duty-cycle Matrix Test"
default n
select RT_USING_PWM
help
Run configurable PWM groups. Channels in one group run concurrently,
while groups run in order. Each channel can keep a fixed output, sweep
once and hold its last point, or repeat its sweep for the group duration.

if RT_UTEST_PWM

config RT_PWM_TC_CONFIG_FILE
string "PWM test configuration header"
default "pwm_tc_config.h"
help
The header defines PWM_TC_GROUPS and PWM_TC_GROUP_COUNT. Keep the
default for the built-in example, or provide a board-specific header
from a compiler include path. Channel enable switches, device names,
channel numbers, output modes, and waveform points are kept in that
header because Kconfig cannot represent dynamic group/channel arrays.

config RT_PWM_TC_MAX_CHANNELS
int "Maximum concurrent channels in one PWM test group"
range 1 64
default 8
help
This limits enabled channels, not the total number of configured and
disabled channel entries in a group.

config RT_PWM_TC_TIMEOUT
int "PWM test timeout in seconds"
range 1 3600
default 30

endif

endmenu
13 changes: 13 additions & 0 deletions components/drivers/misc/utest/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Import('rtconfig')
from building import *

cwd = GetCurrentDir()
src = []
CPPPATH = [cwd, cwd + '/../../include']

if GetDepend(['RT_UTEST_PWM']):
src += ['pwm_tc.c']

group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_PWM'], CPPPATH = CPPPATH)

Return('group')
Loading
Loading