Skip to content

Commit 27b54f5

Browse files
authored
CI waveform flavour select (esp8266#7715)
* every other ci builder uses waveform phase lock * fix indentation * same defaults for PIO as in IDE * CI: force logging without error/warning * remove forced logging
1 parent 4c7a208 commit 27b54f5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tests/common.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ function build_sketches()
6666
local sketches=$(find $srcpath -name *.ino | sort)
6767
print_size_info >size.log
6868
export ARDUINO_IDE_PATH=$arduino
69+
local pwm_phase=""
70+
[ $(( $build_rem % 2 )) -eq 0 ] && pwm_phase="--waveform_phase"
6971
local testcnt=0
7072
for sketch in $sketches; do
7173
testcnt=$(( ($testcnt + 1) % $build_mod ))
@@ -104,16 +106,16 @@ function build_sketches()
104106
fi
105107
echo -e "\n ------------ Building $sketch ------------ \n";
106108
# $arduino --verify $sketch;
107-
if [ "$WINDOWS" == "1" ]; then
109+
if [ "$WINDOWS" == "1" ]; then
108110
sketch=$(echo $sketch | sed 's/^\/c//')
109111
# MINGW will try to be helpful and silently convert args that look like paths to point to a spot inside the MinGW dir. This breaks everything.
110112
# http://www.mingw.org/wiki/Posix_path_conversion
111113
# https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471
112114
export MSYS2_ARG_CONV_EXC="*"
113115
export MSYS_NO_PATHCONV=1
114116
fi
115-
echo "$build_cmd $sketch"
116-
time ($build_cmd $sketch >build.log)
117+
echo "$build_cmd $pwm_phase $sketch"
118+
time ($build_cmd $pwm_phase $sketch >build.log)
117119
local result=$?
118120
if [ $result -ne 0 ]; then
119121
echo "Build failed ($1)"

tools/build.py

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args):
6969
'ResetMethod=nodemcu'.format(**vars(args))
7070
if args.debug_port and args.debug_level:
7171
fqbn += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args))
72+
if args.waveform_phase:
73+
fqbn += ',waveform=phase'
7274
cmd += [fqbn]
7375
cmd += ['-built-in-libraries', ide_path + '/libraries']
7476
cmd += ['-ide-version=10607']
@@ -115,6 +117,8 @@ def parse_args():
115117
type=int, choices=[40, 80])
116118
parser.add_argument('--debug_port', help='Debug port',
117119
choices=['Serial', 'Serial1'])
120+
parser.add_argument('--waveform_phase', action='store_true',
121+
help='Select waveform locked on phase')
118122
parser.add_argument('--debug_level', help='Debug level')
119123
parser.add_argument('--build_cache', help='Build directory to cache core.a', default='')
120124
parser.add_argument('sketch_path', help='Sketch file path')

tools/platformio-build.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def scons_patched_match_splitext(path, suffixes=None):
240240
#
241241
# Waveform
242242
#
243-
if "PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PWM" in flatten_cppdefines:
244-
env.Append(CPPDEFINES=[("WAVEFORM_LOCKED_PWM", 1)])
245-
# PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PHASE will be used by default
243+
if "PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PHASE" in flatten_cppdefines:
244+
env.Append(CPPDEFINES=[("WAVEFORM_LOCKED_PHASE", 1)])
245+
# PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PWM will be used by default
246246

247247
#
248248
# VTables

0 commit comments

Comments
 (0)