]> the.earth.li Git - temper-clone.git/log
temper-clone.git
5 years agoRemove unused read_temp() function main
Jonathan McDowell [Fri, 13 Jul 2018 17:20:25 +0000 (18:20 +0100)]
Remove unused read_temp() function

The temperature is read as part of a state machine in the main loop so
we don't tie thing up for too long, so this is no longer necessary.

5 years agoSwitch state machine transitions to increment
Jonathan McDowell [Thu, 12 Jul 2018 12:27:53 +0000 (13:27 +0100)]
Switch state machine transitions to increment

Rather than explicitly setting the next state just increment
the current state - makes it easier to add extra states.

5 years agoPoll temperature on a 10s basis
Jonathan McDowell [Thu, 10 May 2018 19:58:29 +0000 (20:58 +0100)]
Poll temperature on a 10s basis

Rather than polling the temperature sensor when the host requests it
use a timer to poll every 10s and store the result. This means we can
reply quicker when requests, reducing the number of errors we see on
the host due to USB issues. Fixes interaction with the double request
python-temperusb does for every check.

5 years agoDo USB disconnect/reconnect dance before initialising USB
Jonathan McDowell [Thu, 10 May 2018 07:04:53 +0000 (08:04 +0100)]
Do USB disconnect/reconnect dance before initialising USB

According to http://vusb.wikidot.com/driver-api the initial
usbDeviceDisconnect() / usbDeviceConnect() for enumeration should
be called before doing the usbInit(). Haven't seen problems as a
result, but do so.

5 years agoAdd w1_read_bit() to improve waiting for result
Jonathan McDowell [Thu, 10 May 2018 07:03:19 +0000 (08:03 +0100)]
Add w1_read_bit() to improve waiting for result

Rather than using a full w1_read_byte() to wait for the temperature
sensor to indicate a result is ready introduce a w1_read_bit() and
use that instead. This lets us service USB requests more often while
waiting for the result.

5 years agoReset 1-Wire state if we get a USB reset
Jonathan McDowell [Tue, 8 May 2018 20:45:13 +0000 (21:45 +0100)]
Reset 1-Wire state if we get a USB reset

A client can decide to reset us if we fail to reply to USB messages
appropriately while doing the 1-Wire bits for temperature retrieval.
This may leave us in the state were we have a message ready to go,
but the client isn't going to read it. If we see a USB reset, reset
our state and clear any indication that we have a message to go.

5 years agoAdd initial temperature reading via DS18B20 device
Jonathan McDowell [Thu, 3 May 2018 21:39:27 +0000 (22:39 +0100)]
Add initial temperature reading via DS18B20 device

Actually plumb the 1-Wire support into the temperature query and
use an attached DS18B20 to retrieve the current temperature. This
*mostly* works with the existing TEMPer clients but there are
occasional USB issues, I think due to timing on the 1-Wire delays
affecting USB responses.

5 years agoAdd initial 1-Wire support and use it for the USB serial #
Jonathan McDowell [Thu, 3 May 2018 21:26:36 +0000 (22:26 +0100)]
Add initial 1-Wire support and use it for the USB serial #

Introduce some basic bit-banging 1-Wire functions and use them to
detect if there is a 1-Wire device present and if so use its ROM ID
as the USB serial number.

5 years agoAdd initial TEMPerV1.2 clone skeleton
Jonathan McDowell [Wed, 2 May 2018 17:47:22 +0000 (18:47 +0100)]
Add initial TEMPerV1.2 clone skeleton

This is a clone of the pcsensors.com TEMPerV1.2 device. At present
we just lie and claim 15°C rather than supporting a temperature
sensor. Tested with pcsensor-temper, temper-python + TEMPered.

5 years agoAdd skeleton usbconfig.h for Digispark
Jonathan McDowell [Wed, 2 May 2018 07:08:47 +0000 (08:08 +0100)]
Add skeleton usbconfig.h for Digispark

This is the upstream usbconfig-prototype.h with the port / interrupt
definitions changed to suit the DigiSpark.

5 years agoAdd basic Makefile targeting Digispark
Jonathan McDowell [Tue, 1 May 2018 17:32:39 +0000 (18:32 +0100)]
Add basic Makefile targeting Digispark

Assumes the existence of a main.c containing the main code, and
builds the rest of the V-USB code with it.

6 years agoUse existing OSCCAL as starting point for calibration
Jonathan McDowell [Sat, 14 Jan 2017 11:41:14 +0000 (11:41 +0000)]
Use existing OSCCAL as starting point for calibration

If we're being loaded from micronucleus it will have already
performed calibration on OSCCAL, so use that as the starting point
for our recalibration. This seems to improve things on an older Dell
host that previously had issues enumerating the device.

6 years agoMove to micronucleus assembly for OSCCAL calibration
Jonathan McDowell [Sat, 14 Jan 2017 01:07:09 +0000 (01:07 +0000)]
Move to micronucleus assembly for OSCCAL calibration

Some issues have been observed with OSCCAL calibration on older Dell
hosts. The micronucleus firmware enumerates correctly, but the Riso
clone then fails. Move to the assembly calibration code from
micronucleus to try and improve the situation.

Imported from https://github.com/micronucleus/micronucleus.git,
commit 7a53ce9e539a18fb46f7dc8e759f14833b10cc0c (July 31st 2016).

7 years agoAdd .gitignore file
Jonathan McDowell [Wed, 18 May 2016 17:22:51 +0000 (18:22 +0100)]
Add .gitignore file

7 years agoInclude usbdrv.h in osccal.c for usbMeasureFrameLength definition
Jonathan McDowell [Wed, 18 May 2016 10:19:56 +0000 (11:19 +0100)]
Include usbdrv.h in osccal.c for usbMeasureFrameLength definition

7 years agoAdd license file (GPLv3)
Jonathan McDowell [Wed, 18 May 2016 08:53:09 +0000 (09:53 +0100)]
Add license file (GPLv3)

7 years agoInitial import of V-USB as base
Jonathan McDowell [Wed, 18 May 2016 08:51:50 +0000 (09:51 +0100)]
Initial import of V-USB as base

Import V-USB from https://github.com/obdev/v-usb.git, commit
39202048ea1fb7d14a5970c805ffd5f0b7f0fcdf (September 4th 2015).