summarylogtreecommitdiffstats
path: root/atomicpi-hold-mic
blob: 56c747934712b0f2ab91ea9bc756498397e3ac53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

. /usr/lib/atomicpi.sh

if [ "$1" = "--cleanup" ]; then
    atomicpi_gpio_hardware && gpioset --mode=time --us=200000 $ATOMICPICHIP_AU_MIC_SEL=1
fi

if [ -z "$1" ]; then
    # Hold AU_MIC_SEL low to enable recording from microphone
    if atomicpi_gpio_hardware; then
        exec gpioset --mode=signal $ATOMICPICHIP_AU_MIC_SEL=0
    else
        while true; do
            sleep 2147483647;
        done
    fi
fi