aboutsummaryrefslogtreecommitdiff
path: root/accel.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-09Replace array size calculation with macroLars-Dominik Braun1-6/+6
2015-06-09Fix interrupt-based shake/horizon detectionLars-Dominik Braun1-33/+35
Fixes commit e2e3038c627ea7460915cdd535cb91301af614a7.
2015-02-27Add licenseLars-Dominik Braun1-0/+23
2015-02-26accel: Stop pollingLars-Dominik Braun1-131/+123
Use freefall interrupts instead. This drop the fancy horizon/shake detection algorithms, but it works surprisingly well and is way more energy-efficient. Shake detection is a little too sensitive imo and horizon detection needs some tweaking too.
2015-02-10accel: NonblockingLars-Dominik Braun1-44/+63
2015-02-10Reduce CPU frequencyLars-Dominik Braun1-15/+13
Also reduces PWM frequency. The speakers resonance frequency is 2kHz, with 1MHz clock speed and prescaler 256 we get pretty close.
2015-01-29accel: Ignore shake if horizon changedLars-Dominik Braun1-2/+9
2015-01-29accel: Fix shake detection, againLars-Dominik Braun1-8/+13
Only two peaks are required. Use int16 to avoid overflow. Check sign before registering shake in other direction.
2015-01-13Remove debugging puts/fwriteLars-Dominik Braun1-5/+3
We’re tight on SRAM and the stack seems overflow from time to time. Removing the strings should give us some breathing room.
2014-12-09accel: Fix shake gesture detectionLars-Dominik Braun1-51/+50
2014-11-25gyro/accel: Disable pull-upsLars-Dominik Braun1-6/+5
Not sure they are needed.
2014-09-30Reliable reboot, idle status LED indicatorLars-Dominik Braun1-0/+2
2014-09-30Add wakeup source mechanismLars-Dominik Braun1-5/+13
Should reduce amount of cpu wakeups with expensive computations.
2014-07-29i2c: Make sure status is _OKLars-Dominik Braun1-1/+1
Not sure if this fixes anything.
2014-07-22Convert printf into putsLars-Dominik Braun1-4/+5
Removes ~1.5k code size, still not working.
2014-06-17ui: AddedLars-Dominik Braun1-0/+4
Seems to work mostly now.
2014-05-27Fix compiler warningsLars-Dominik Braun1-3/+3
2014-05-20gyro/accel: disable x/y axisLars-Dominik Braun1-12/+10
Currently unused.
2014-05-06accel: Add horizon/shake detectionLars-Dominik Braun1-0/+109
2014-04-22Fix interrupt stuffLars-Dominik Braun1-8/+7
Sorta polling based now, with interrupts used to wake up from sleep only. At least it works.
2014-04-22Increase CPU and UART speedLars-Dominik Braun1-1/+1
Re-enable interrupt based accel.
2014-04-22Activate accel + timerLars-Dominik Braun1-12/+15
2014-04-22Add common.hLars-Dominik Braun1-5/+2
2014-04-22Initial accel implementationLars-Dominik Braun1-0/+88