1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 15:37:31 +02:00
Commit Graph

62 Commits

Author SHA1 Message Date
Werner Almesberger
08b06adbf9 fw/avrdude-antorcha.conf: move to common/ and share with whirl/fw/ 2012-11-17 16:08:23 -03:00
Werner Almesberger
bff9ca5801 fw/accel.c (adcsra): correct typo in comment 2012-07-31 10:02:34 -03:00
Werner Almesberger
d87f5fa0f5 fw/avrdude-antorcha.conf: correct description 2012-07-22 12:26:12 -03:00
Werner Almesberger
a46d226efb use new avrdude -L option to load project-specific config file 2012-07-22 12:12:33 -03:00
Werner Almesberger
8108aaccd1 fw/diag.c (do_diag): update explanation why we don't enable interrupts
The hang was caused by the RF subsystem getting into trouble. The
interrupts still cause some issues, so we don't enable them yet.
A system reset (ant-cl -R) will clean up everything nicely.
2012-07-06 16:58:53 -03:00
Werner Almesberger
a70caced48 fw/antorcha.c (main): reset the RF subsystem if it's idle for ~1 second
For some reason, DIAG often stalls the RF subsystem. The periodic reset
brings it back to life.
2012-07-06 16:53:10 -03:00
Werner Almesberger
206eb4d591 clean up diagnostic more and make it more robust
A number of changes:
- don't enable interrupts, since they often cause hangs (not sure why)
- remove GND measurement
- wait 100 us between AMUX setup and start of conversion, to let input
  settle
- reduce delay between line setup and samping from 100 ms to 50 ms,
  for this is already sufficient
2012-07-01 19:40:01 -03:00
Werner Almesberger
43686321a7 fw/diag.c: fix and improve DIAG function
- we didn't send ACKs for the authentication packets
- take multiple samples (4)
- add 100 ms delay to let the battery voltage settle
2012-07-01 11:53:51 -03:00
Werner Almesberger
19fb0d31fa fw/: add DIAG protocol (supply voltage measurement, for diagnostics) 2012-07-01 10:43:37 -03:00
Werner Almesberger
1be433e65f fw/accel.c (measure_ref): GND and Vbg measurement function (for diagnostics) 2012-07-01 10:38:59 -03:00
Werner Almesberger
a4eeb43963 fw/sweep.c (set_line): export line setting (output on LEDs) function 2012-07-01 10:24:18 -03:00
Werner Almesberger
69d9013a0d fw/image.c (localize_line): export line format conversion function 2012-07-01 10:20:33 -03:00
Werner Almesberger
6fac517d48 fw/: move secrets to secret.c; rename reset secret to maintenance secret 2012-07-01 10:08:50 -03:00
Werner Almesberger
65fbf733c3 fw/hash.h: only #include avr/pgmspace.h when building for AVR (and not for host) 2012-06-29 15:24:13 -03:00
Werner Almesberger
a924364311 fw/rf.c (rf_send): increase delay from 2 ms to 9 ms, for slow atben
Not sure why the Ben exhibited such a long turn-around time. It should
actually be faster than a PC with atusb. Maybe it's because of latency
introduced by other sources.
2012-06-29 10:26:25 -03:00
Werner Almesberger
b4c855f25a revert nonsensical c9923b4282
That's why sleep deprivation is a bad thing ...
2012-06-28 16:35:01 -03:00
Werner Almesberger
a859b3b8b9 fw/proto.h (TP_BWD_START_DEFAULT): raise from 50 ms to 70 ms, like TP_FWD_START_DEFAULT
Going to the longer aluminium stick changed the timing a bit.
2012-06-28 01:53:18 -03:00
Werner Almesberger
c9923b4282 fw/antorcha.c (main): allow a new sweep to preempt an active sweep
Waiting until the current sweep finished could delay the next sweep
(without cancelling it), confusing the timing.
2012-06-28 01:33:31 -03:00
Werner Almesberger
d651c23a04 fw/proto.h: assorted cleanup and corrections
- remove struct params.clkT_period
- correct size of tp_*_start
- correct size of tp_*_pix
- move MAX_LINES from image.h to proto.h (to ease sharing with tools)

Things now work a bit differently from how they were planned back when
clkT_period was added.
2012-06-27 03:07:56 -03:00
Werner Almesberger
0a0792688b fw/: add parameter upload (untested), move parameters from antorcha.c to param.c 2012-06-27 02:36:08 -03:00
Werner Almesberger
276ffd7f44 fw/image.* (image_secret): make image_secret global, for future sharing 2012-06-27 02:30:39 -03:00
Werner Almesberger
308c094af2 fw/: rearrange parameters and move defaults from antorcha.c to proto.h 2012-06-27 02:15:50 -03:00
Werner Almesberger
cb846be507 fw/antorcha.c: add backward sweep 2012-06-25 11:37:16 -03:00
Werner Almesberger
00180fb287 try cleaner sweep synchronization algorithm
The predictive part doesn't produce useful results so far, so we still
use a fixed offset from the trigger.
2012-06-25 10:48:19 -03:00
Werner Almesberger
023c2aa1e9 fw/: base sweep start time on absolute time
This way, we can define the next sweep while the previous one is still
in progress.
2012-06-24 11:59:52 -03:00
Werner Almesberger
646f54d25c fw/sweep.c (TIMER1_OVF_vect): turn off the LEDs when done
This means that the image no longer has to contain terminating all-zero rows.
2012-06-23 22:29:05 -03:00
Werner Almesberger
695bc5a25a fw/: reduce image width from 100 to 80 square pixels
To achieve square 100 pixels (1:6.25 image aspect ratio), very vigorous
movement is needed. 80 pixels (still 1:5) are easier. Initial estimates
suggested a usable range of 1:4-1:5, so this is still good.

Note that we may want to change the aspect ratio of the pixels themselves
in the future (for smoother letters), so the pixel count may go up again.

80 pixels correspond to 11 characters in a 7x5 font with 2 pixels
separation between characters. We may want to go up to 82 pixels
to allow a 12th character - or use a proportional font.
2012-06-23 21:57:18 -03:00
Werner Almesberger
7816ea89d5 fw/antorcha.c: crude synchronization of image with movement
Doesn't look too bad for a first try.
2012-06-23 21:53:26 -03:00
Werner Almesberger
dd72f4642e fw/spi.c: explain why we probably can't reach fosc/2 = 4 MHz 2012-06-23 14:54:31 -03:00
Werner Almesberger
18c7b43a59 fw/reset.c: oops, forgot to commit the reset protocol handler 2012-06-23 12:03:25 -03:00
Werner Almesberger
06f9907cae fw/image.c: put image_secret in PROGMEM to save scarce RAM 2012-06-23 12:01:37 -03:00
Werner Almesberger
a59bb00a27 fw/hash.[ch]: new function hash_merge_progmem to read from Flash instead of RAM 2012-06-23 11:59:47 -03:00
Werner Almesberger
e2f228907b fw/accel.c (adcsra): let ADC run at 125 kHz (instead of 67.5 kHz) 2012-06-21 21:12:20 -03:00
Werner Almesberger
b262e2f142 fw/spi.c (spi_init): revert the SPI speed increase (caused instability)
Some more testing showed that transfers would get stuck after ~40 packets.
Need to find out what happened before trying this again.
2012-06-21 19:52:41 -03:00
Werner Almesberger
ffcfd3d09d fw/spi.c (spi_init): raise SPI speed from fosc/4 to fosc/2 2012-06-21 19:38:44 -03:00
Werner Almesberger
28cf696a08 fw/sample.c (handler): set the time in samples (was set to zero, for debugging) 2012-06-21 19:16:55 -03:00
Werner Almesberger
8eca4c99c7 fw/sample.c: fix logic in handler() and filter incomplete samples
An incomplete sample would be an X value followed by another X value,
or Y followed by Y. Not entirely sure why this happens in the first
place, but it does happen.
2012-06-21 16:17:47 -03:00
Werner Almesberger
58e0dda95d fw/accel.c: use timer 0 to trigger a pair of conversions (X/Y) only every 1 ms 2012-06-21 16:15:56 -03:00
Werner Almesberger
c7494c80fa fw/accel.c: fix update() add interrupt-friendly update_irq()
Still untested.
2012-06-21 16:14:56 -03:00
Werner Almesberger
27455749bd fw/: add acceleration sensor sample protocol (untested) 2012-06-21 12:51:57 -03:00
Werner Almesberger
7a0bc4cb9c fw/spi.c: clean up code and add option for running at fosc/2 instead of fosc/4
Not enabled yet. There's a RF comm regression elsewhere that needs fixing
first.
2012-06-21 12:03:32 -03:00
Werner Almesberger
eaa11b110c fw/: sample the acceleration sensor (untested) 2012-06-21 08:56:56 -03:00
Werner Almesberger
7045109090 fw/accel.c: keep track of uptime and return it with uptime() (untested) 2012-06-21 08:56:41 -03:00
Werner Almesberger
2bac5e74a7 fw/image.c (image_first): call image_more to process the payload
This makes things work also for zero-sized files. I.e.,

./antorcha /dev/null

does precisely what one would expect. (Before, the transfer was
accepted, but the first salt block became the new image.)
2012-06-20 18:39:29 -03:00
Werner Almesberger
2011c515c8 fw/: pass limit also to "first" function of protocol handlers 2012-06-20 18:37:13 -03:00
Werner Almesberger
c6fc8190de fw/image.c: fix use of hash functions; make image pointer setup more readable
It was almost impossible NOT to read

next_image = p = image == images[0] ? ...
                      ^^^^
as if it was

next_image = p = image = images[0] ? ...
                      ^^^
2012-06-20 16:51:40 -03:00
Werner Almesberger
1668e702e5 fw/dispatch.c: fix initial sequence number; some cleanup 2012-06-20 16:50:55 -03:00
Werner Almesberger
ab00d8e231 fw/antorcha.c: don't overrun image by one line in test mode 2012-06-20 16:48:16 -03:00
Werner Almesberger
b7d80f1340 fw/fw.c: simplify the use of the sequence number a little (untested)
Not sure if this even produces better code. It looks a bit cleaner, though.
2012-06-20 16:46:27 -03:00
Werner Almesberger
6286aa9bbc fw/sweep.c: use ICR1 instead of double-buffered OCR1A; set pixel_ticks
Our timing is now accurate within a measured 0.5% on the test device,
which is well within the specified 1% of the calibrated RC oscillator.
2012-06-20 16:40:33 -03:00