forked from Mirrors/usk
Compare commits
4 commits
bct-resync
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dd3a01989 | ||
| 8eb749f6f2 | |||
|
|
71266314eb | ||
|
|
c0f8d7c186 |
4 changed files with 7 additions and 13 deletions
11
main.c
11
main.c
|
|
@ -55,7 +55,7 @@ void self_test()
|
||||||
{
|
{
|
||||||
absolute_time_t tio_time = make_timeout_time_ms(2500);
|
absolute_time_t tio_time = make_timeout_time_ms(2500);
|
||||||
adc_init();
|
adc_init();
|
||||||
bool rst_ok = false, cmd_ok = false, d0_ok = false, clk_ok = false;
|
bool rst_ok = false, cmd_ok = false, d0_ok = false;
|
||||||
while (!time_reached(tio_time)) {
|
while (!time_reached(tio_time)) {
|
||||||
if (!rst_ok)
|
if (!rst_ok)
|
||||||
rst_ok |= safe_test_voltage(PIN_RST, 1.8f, 0.2f);
|
rst_ok |= safe_test_voltage(PIN_RST, 1.8f, 0.2f);
|
||||||
|
|
@ -63,9 +63,7 @@ void self_test()
|
||||||
cmd_ok |= safe_test_voltage(PIN_CMD, 1.8f, 0.2f);
|
cmd_ok |= safe_test_voltage(PIN_CMD, 1.8f, 0.2f);
|
||||||
if (!d0_ok)
|
if (!d0_ok)
|
||||||
d0_ok |= safe_test_voltage(PIN_DAT, 1.8f, 0.2f);
|
d0_ok |= safe_test_voltage(PIN_DAT, 1.8f, 0.2f);
|
||||||
if (!clk_ok)
|
if (rst_ok && cmd_ok && d0_ok)
|
||||||
clk_ok |= safe_test_voltage(PIN_CLK, 1.8f, 0.2f);
|
|
||||||
if (rst_ok && cmd_ok && d0_ok && clk_ok)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!rst_ok)
|
if(!rst_ok)
|
||||||
|
|
@ -80,11 +78,6 @@ void self_test()
|
||||||
{
|
{
|
||||||
halt_with_error(2, 2);
|
halt_with_error(2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!clk_ok)
|
|
||||||
{
|
|
||||||
halt_with_error(3, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool was_self_reset;
|
extern bool was_self_reset;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ fi
|
||||||
# detect distribution
|
# detect distribution
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
DISTRO=$ID
|
DISTRO=${ID-LIKE:-$ID}
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: Cannot detect distribution${NC}"
|
echo -e "${RED}Error: Cannot detect distribution${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -128,4 +128,4 @@ echo -e " - update.bin: ${WORKSPACE}/build/usk/update.bin"
|
||||||
USK_VERSION_LO=$(sed -n 's/#define VER_LO \([0-9]*\)/\1/p' "$USK_DIR/config.h")
|
USK_VERSION_LO=$(sed -n 's/#define VER_LO \([0-9]*\)/\1/p' "$USK_DIR/config.h")
|
||||||
USK_VERSION_HI=$(sed -n 's/#define VER_HI \([0-9]*\)/\1/p' "$USK_DIR/config.h")
|
USK_VERSION_HI=$(sed -n 's/#define VER_HI \([0-9]*\)/\1/p' "$USK_DIR/config.h")
|
||||||
USK_VERSION="${USK_VERSION_HI}.${USK_VERSION_LO}"
|
USK_VERSION="${USK_VERSION_HI}.${USK_VERSION_LO}"
|
||||||
echo -e "${GREEN}Version: Picofly ${USK_VERSION}${NC}\n"
|
echo -e "${GREEN}Version: Picofly ${USK_VERSION}${NC}\n"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ echo -e "${GREEN}=== Picofly build script (multi-distro) ===${NC}\n"
|
||||||
# detect distribution
|
# detect distribution
|
||||||
if [ -f /etc/os-release ]; then
|
if [ -f /etc/os-release ]; then
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
DISTRO=$ID
|
DISTRO=${ID_LIKE:-$ID}
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: Cannot detect distribution${NC}"
|
echo -e "${RED}Error: Cannot detect distribution${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -127,4 +127,4 @@ echo -e " - update.bin: ${WORKSPACE}/build/usk/update.bin"
|
||||||
USK_VERSION_LO=$(sed -n 's/#define VER_LO \([0-9]*\)/\1/p' "$WORKSPACE/usk/config.h")
|
USK_VERSION_LO=$(sed -n 's/#define VER_LO \([0-9]*\)/\1/p' "$WORKSPACE/usk/config.h")
|
||||||
USK_VERSION_HI=$(sed -n 's/#define VER_HI \([0-9]*\)/\1/p' "$WORKSPACE/usk/config.h")
|
USK_VERSION_HI=$(sed -n 's/#define VER_HI \([0-9]*\)/\1/p' "$WORKSPACE/usk/config.h")
|
||||||
USK_VERSION="${USK_VERSION_HI}.${USK_VERSION_LO}"
|
USK_VERSION="${USK_VERSION_HI}.${USK_VERSION_LO}"
|
||||||
echo -e "${GREEN}Version: Picofly ${USK_VERSION}${NC}\n"
|
echo -e "${GREEN}Version: Picofly ${USK_VERSION}${NC}\n"
|
||||||
|
|
|
||||||
1
test123
Normal file
1
test123
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
asdöfgljkklgj
|
||||||
Loading…
Reference in a new issue