Initial commit

This commit is contained in:
Philip Trauner 2018-04-07 23:26:16 +02:00
commit df5befa9d1
45 changed files with 2030 additions and 0 deletions

View 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})"

View 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

View 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..."

View 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)

View 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

View file

@ -0,0 +1,5 @@
Section "Device"
Identifier "Builtin Default fbdev Device 0"
Driver "fbdev"
# Option "Rotate" "UD"
EndSection

View 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

Binary file not shown.