1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-09-30 05:35:25 +03:00

prod/: on-going development

- prod/Common: added section titles
- prod/Common (begin): new command to set up and check the test environment
- prof/atben: call "begin" to set up the test environment
- prod/Common (spectrum): added the profile
- prod/Makefile: convenience commands, for development
- prod/atben: run "identify" after checking the GPIOs
- prod/atusb: test script for ATUSB
This commit is contained in:
Werner Almesberger 2011-04-20 08:13:27 -03:00
parent 04db5e0418
commit cd59b8524b
4 changed files with 111 additions and 3 deletions

View File

@ -26,6 +26,10 @@ else
LOCAL_DUT=default LOCAL_DUT=default
fi fi
##### Test setup ############################################################
step() step()
{ {
echo -n " .... $1" echo -n " .... $1"
@ -36,6 +40,9 @@ step()
} }
##### Test result ###########################################################
finish() finish()
{ {
echo "$cmd" >>$LOG echo "$cmd" >>$LOG
@ -73,12 +80,18 @@ todo()
} }
##### Test execution ##########################################################
cmd() cmd()
{ {
cmd=$1 cmd=$1
} }
##### Evaluation ############################################################
expect() expect()
{ {
eval "$cmd" >_out 2>&1 || { echo "exit code $?" | fail; exit 1; } eval "$cmd" >_out 2>&1 || { echo "exit code $?" | fail; exit 1; }
@ -95,6 +108,23 @@ expect_re()
} }
##### Tests #################################################################
begin()
{
if [ -z "$1" ]; then
echo "usage: begin profile" 1>&2
exit 1
fi
PROFILE=$1
if [ ! -r $PROFILE ]; then
echo "$PROFILE not found" 1>&2
exit 1
fi
}
identify() identify()
{ {
step "Identification" step "Identification"
@ -108,10 +138,9 @@ spectrum()
step "Spectrum" step "Spectrum"
# todo: # todo:
# - trim values (maybe) # - trim values (maybe)
# - profile
# - decide on power # - decide on power
# - decide on offset # - decide on offset
cmd "atrf-path -g -T +0.5 $REF $DUT 10" cmd "atrf-path -g -T +0.5 -P $PROFILE $REF $DUT 10"
expect PASS expect PASS
} }

20
prod/Makefile Normal file
View File

@ -0,0 +1,20 @@
#
# This Makefile just contains a few convenience commands, for development
#
.PHONY: all ben usb
all: ben
ben: ben.profile
./atben net:ben net:jlime
usb: usb.profile
./atusb net:ben usb
ben.profile:
cp ../tools/atrf-path/profile.example $@
usb.profile:
cp ../tools/atrf-path/profile.example $@

View File

@ -18,9 +18,10 @@ xtal_ben()
} }
identify begin ben.profile
# power ? # power ?
gpio_ben gpio_ben
identify
xtal_ben xtal_ben
spectrum spectrum
transmit transmit

58
prod/atusb Executable file
View File

@ -0,0 +1,58 @@
#!/bin/sh
. ./Common
flash()
{
step "Flash boot loader"
todo
}
enumerate()
{
step "Enumeration"
todo
}
led()
{
step "LED"
todo
}
dfu()
{
step "DFU application"
todo
}
gpio_usb()
{
step "GPIO scan"
todo
}
xtal_usb()
{
step "Crystal frequency"
todo
}
begin usb.profile
flash
enumerate
led
dfu
# power ?
gpio_usb
# identify # local anomaly (using a 230-based card at the moment)
xtal_usb
spectrum
transmit