summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-03-26 08:39:10 -0500
committerJohn Klug <john.klug@multitech.com>2021-06-23 04:16:07 -0500
commit008257e9bc01045f117539a5fca9c2c7939b1cc9 (patch)
treeb124c969614c5ec3c44af0c4e01b4e58360f3e63
parentfc945d92000e0755d0530297caccd6c04aeefb7b (diff)
downloadmeta-multitech-008257e9bc01045f117539a5fca9c2c7939b1cc9.tar.gz
meta-multitech-008257e9bc01045f117539a5fca9c2c7939b1cc9.tar.bz2
meta-multitech-008257e9bc01045f117539a5fca9c2c7939b1cc9.zip
Fix bugs in init script, add mts-io-skipcharge package for development and testing
-rw-r--r--recipes-bsp/multitech/mts-io.inc22
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init4
2 files changed, 20 insertions, 6 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 65cb00c..441a09c 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
do_fetch[depends] += "virtual/kernel:do_shared_workdir"
-INC_PR = "r4"
+INC_PR = "r5"
SRCREV = "${PV}"
PR = "${INC_PR}.0-${KERNEL_MODULE_PACKAGE_SUFFIX}"
@@ -47,7 +47,7 @@ do_compile () {
}
-PACKAGES = "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-dev"
+PACKAGES += "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-skipcharge"
RDEPENDS_${PN}-dev = ""
@@ -67,8 +67,9 @@ FILES_${PN}-util += "${sbindir}/mts-util-lora2-reset"
FILES_${PN}-util-dbg += "/usr/src /usr/sbin/.debug"
FILES_${PN}-dev += "${includedir}/linux ${includedir}/mts-kernel-headers"
-INITSCRIPT_NAME = "mts-io"
-INITSCRIPT_PARAMS = "start 39 S ."
+INITSCRIPT_PACKAGES = "${PN}-noarch"
+INITSCRIPT_NAME_${PN}-noarch = "mts-io"
+INITSCRIPT_PARAMS_${PN}-noarch = "start 39 S ."
PARALLEL_MAKE = ""
@@ -114,3 +115,16 @@ fakeroot do_install_append_mtcap() {
install -m 0755 ${WORKDIR}/mts-io.mtcap.init ${D}${sysconfdir}/init.d/mts-io
install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater
}
+
+# skipcharge is to prevent waiting for the supercap to charge on
+# units with a supercap. This is for code development and testing
+# purposes only.
+ALLOW_EMPTY_${PN}-skipcharge = "1"
+RDEPENDS_${PN}-skipcharge = "${PN}-noarch"
+
+pkg_postinst_${PN}-skipcharge() {
+ sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io
+}
+pkg_prerm_${PN}-skipcharge() {
+ sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io
+}
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
index ff0e947..f8e611f 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -16,7 +16,6 @@ set_hw_name() {
hw_name=(${hw//-/ })
}
-batcap=$(mts-io-sysfs show capability/battery)
set_batt_charge() {
if [[ $batcap == 1 ]] ; then
i2cset -m 0x60 -y 0 0x09 0x01 0x20
@@ -113,7 +112,7 @@ wait_for_supercap() {
return
fi
if ((SUPERCAPFULL != 1)) ; then
- break
+ return
fi
t0=$(gettime)
maxwait=$(awk "BEGIN {print ${t0}+${SUPERCAPFULL_MAXWAIT}}")
@@ -151,6 +150,7 @@ case $1 in
# Point the firmware API at our i2c EEPROMs
echo -n ${i2c} > /sys/module/firmware_class/parameters/path
modprobe mts_io
+ batcap=$(mts-io-sysfs show capability/battery)
setwificap
set_batt_charge
wifi_init1