commit 6f4476062dc89c9e91667072b73d086c43fca8ad
parent 4f631912a9adf21db0045ca495bb2514344eb52d
Author: Lukas F. Hartmann <lukas@mnt.mn>
Date: Mon, 12 Nov 2018 13:18:49 +0100
minor cleanups
Diffstat:
2 files changed, 11 insertions(+), 66 deletions(-)
diff --git a/handbook/source/TODO.rst b/handbook/source/TODO.rst
@@ -1,55 +0,0 @@
-topics todo
-===========
-
-faq
-- how full/empty is the battery?
-- how do i change the display brightness?
-
- brightnessctl s [1-7]
-
-- what temperature does the cpu/system have?
-
- cat /sys/class/thermal/thermal_zone0/temp
-
-- how do i use the proprietary hardware video decoder?
-
-- what does the boot rom do?
-- where are the schematics for tinyRex?
-- where are the schematics for REFORM?
-
- The schematics of the motherboard, keyboard and trackball are in the git repository https://github.com/mntmn/reform
-
-- how do i use an LTE modem/WWAN?
-
- The only modem tested so far is Huawei XYZ999. It presents itself as 5 serial ports (tty*) and an ethernet device in the system.
- You have to connect with a serial terminal like screen to /dev/tty* and issue AT commands to unlock the SIM and connect to the internet.
-
-- how do i setup WiFi on the console?
-
- wicd-curses
-
-- can i use a discrete graphics card by nvidia or amd?
-- what is the resolution of the display?
-
-The internal display has a resolution of 1366x768, but it is configured in the device tree (DTS) as 1368x768 to avoid problems with graphics drivers/hardware that can only handle multiples of 8 as the width.
-
-- what is the maximum resolution of HDMI?
-
-The maximum tested resolution of the HDMI output is 1920x1200.
-
-- how do i use the microphone input in the headphone jack?
-- where are the speakers?
-
-Reform does not include any speakers, but a stereo speaker module is in the making. You can also build your own by connecting an amplifier and speakers to the motherboard header labelled Line Out.
-
-- how do i use SPI, I2C, GPIO?
-- how do i use CSI, DSI?
-- how can i use the bootrom's usb device mode?
-- how do i print/make my own case part?
-- how do i make a new keycap?
-- how to use OpenGL/ES hardware acceleration in Xorg?
-- how to use OpenGL/ES hardware acceleration in wayland?
-- software/game XYZ does not work, is there a workaround?
-- how can i run x86 software?
-- how can i run Raspberry Pi compatible software?
-
diff --git a/reform-tiny-fw/reform-tiny-fw.ino b/reform-tiny-fw/reform-tiny-fw.ino
@@ -8,11 +8,13 @@
#define SCL_PORT PORTA
#define SDA_PIN 1
#define SDA_PORT PORTA
+#define HALL_SENSOR_PIN A5
+#define HALL_SENSOR_SUPPLY_PIN 4
+#define INA_ADDR 0x4e
+
#include <SoftI2CMaster.h>
#include <SoftwareSerial.h>
-#define INA_ADDR 0x4e
-
int16_t ina_read16(unsigned char reg) {
uint16_t val = 0;
if (i2c_start((INA_ADDR << 1) | I2C_WRITE)) {
@@ -54,8 +56,9 @@ float current = 0;
char cmd = 'a';
unsigned char echo = 1;
+// TODO if there is no battery power, ignore lid sensor (values >900)
void handleLidSensor() {
- hallSense = analogRead(A10);
+ hallSense = analogRead(HALL_SENSOR_PIN);
if (hallSense>(thresh+window) && hallState==LID_OPEN) {
hallState = LID_CLOSED;
}
@@ -226,14 +229,11 @@ void setup() {
softSerial.println("error:i2c");
}
- // physical pin 3 for hall effect sensor
- pinMode(A10, INPUT);
- // physical pin 2 for hall effect sensor supply voltage
- pinMode(0, OUTPUT);
- digitalWrite(0, HIGH);
- // physical pin 5 for hall effect sensor GND
- pinMode(2, OUTPUT);
- digitalWrite(2, LOW);
+ // physical pin 8 (J34 pin 3) for hall effect sensor
+ pinMode(HALL_SENSOR_PIN, INPUT);
+ // physical pin 7 (J34 pin 5) for hall effect sensor supply voltage
+ pinMode(HALL_SENSOR_SUPPLY_PIN, OUTPUT);
+ digitalWrite(HALL_SENSOR_SUPPLY_PIN, HIGH);
// PWRON output (TODO: ULVO)
pinMode(7, OUTPUT);