Initial commit
This commit is contained in:
commit
df5befa9d1
45 changed files with 2030 additions and 0 deletions
16
root-fs/usr/bin/wallaby_get_id.sh
Executable file
16
root-fs/usr/bin/wallaby_get_id.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
VCMD1='i2cget -y 0 0x50 0x40'
|
||||
VCMD2='i2cget -y 0 0x50 0x41'
|
||||
VCMD3='i2cget -y 0 0x50 0x42'
|
||||
VCMD4='i2cget -y 0 0x50 0x43'
|
||||
|
||||
V1=$(eval $VCMD1)
|
||||
V2=$(eval $VCMD2)
|
||||
V3=$(eval $VCMD3)
|
||||
V4=$(eval $VCMD4)
|
||||
|
||||
printf "\x$(printf %x ${V1})"
|
||||
printf "\x$(printf %x ${V2})"
|
||||
printf "\x$(printf %x ${V3})"
|
||||
printf "\x$(printf %x ${V4})"
|
7
root-fs/usr/bin/wallaby_init_gpio
Executable file
7
root-fs/usr/bin/wallaby_init_gpio
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo 33 > /sys/class/gpio/export
|
||||
echo 34 > /sys/class/gpio/export
|
||||
|
||||
echo "out" > /sys/class/gpio/gpio33/direction
|
||||
echo "out" > /sys/class/gpio/gpio34/direction
|
13
root-fs/usr/bin/wallaby_reset_coproc
Executable file
13
root-fs/usr/bin/wallaby_reset_coproc
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! -d "/sys/class/gpio/gpio34" ]; then
|
||||
echo "gpio34 missing - initializing gpio pins"
|
||||
wallaby_init_gpio
|
||||
fi
|
||||
|
||||
echo "resetting co processor..."
|
||||
echo 1 > /sys/class/gpio/gpio34/value
|
||||
echo 0 > /sys/class/gpio/gpio34/value
|
||||
echo 1 > /sys/class/gpio/gpio34/value
|
||||
|
||||
echo "Done..."
|
23
root-fs/usr/bin/wallaby_set_hostname.py
Executable file
23
root-fs/usr/bin/wallaby_set_hostname.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from subprocess import check_output, call
|
||||
|
||||
bot_id = "bot"
|
||||
|
||||
for i2c in range(4):
|
||||
bot_id += check_output("i2cget -y 0 0x50 0x4%i" % i2c, shell=True).decode()[-2]
|
||||
|
||||
new_hosts_content = ""
|
||||
|
||||
for line in open("/etc/hosts", "r").read().split("\n"):
|
||||
if line.startswith("127.0.1.1"):
|
||||
new_hosts_content += "127.0.1.1\t%s\n" % bot_id
|
||||
elif line != "":
|
||||
new_hosts_content += "%s\n" % line
|
||||
|
||||
open("/etc/hosts", "w").write(new_hosts_content)
|
||||
|
||||
call("hostnamectl set-hostname %s" % bot_id, shell=True)
|
||||
call("systemctl restart avahi-daemon", shell=True)
|
||||
|
||||
print("Hostname set: '%s'" % bot_id)
|
12
root-fs/usr/include/kipr/botball.h
Normal file
12
root-fs/usr/include/kipr/botball.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _KIPR_BOTBALL_H_
|
||||
#define _KIPR_BOTBALL_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <wallaby/wallaby.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#endif
|
||||
|
5
root-fs/usr/share/X11/xorg.conf.d/20-display.conf
Executable file
5
root-fs/usr/share/X11/xorg.conf.d/20-display.conf
Executable file
|
@ -0,0 +1,5 @@
|
|||
Section "Device"
|
||||
Identifier "Builtin Default fbdev Device 0"
|
||||
Driver "fbdev"
|
||||
# Option "Rotate" "UD"
|
||||
EndSection
|
6
root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf
Executable file
6
root-fs/usr/share/X11/xorg.conf.d/99-calibration.conf
Executable file
|
@ -0,0 +1,6 @@
|
|||
Section "InputClass"
|
||||
Identifier "calibration"
|
||||
MatchProduct "ADS7846 Touchscreen"
|
||||
Option "Calibration" "359 3711 3537 501"
|
||||
Option "SwapAxes" "0"
|
||||
EndSection
|
BIN
root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf
(Stored with Git LFS)
Executable file
BIN
root-fs/usr/share/fonts/truetype/wqy-zenhei.ttf
(Stored with Git LFS)
Executable file
Binary file not shown.
Reference in a new issue