Comments (5)
@geeksville - can you update this bug with a bit more detail - is the goal to get an interrupt on state changes on AXP192 and update the state?
from firmware.
sure, so the initial axp192 code was based on example code from ttgo which was of pretty low quality. i.e. when I got the datasheet I found some of their register settings were not even correct. I checked the datasheet into the git repo btw.
I'm not sure they picked properly for if the IRQ is even asserted high or low (I haven't looked carefully). Also related to that polling, I noticed that I also had to turn off leaving that IRQ enabled across light sleep (see doLightSleep()) because I was getting woken repeatedly, so I really think the level high vs low for that irq trigger might be wrong.
Probably just a good reading of the datasheet would be good.
from firmware.
btw: I think I might be actually sick with this corona thing (really surprising actually). I woke up last night with chills and a headache, took tylenol and I still have the chills. It isn't too horrible at all but def not a cold. So I'm going to be afk for at least today I think sleeping.
from firmware.
I looked at original t-beam sample and interrupts work in that sketch.
I made some changes to interrupts in main.cpp and they are working. After "Shutdown BT" appears in debug output interrupts stop working until you press middle button to wake it up again, then you get the interrupts which were delayed, so maybe light sleep or whatever state we go into needs to have interrupts enabled if we want to get interrupts immediately rather than delayed? I added some more interrupt events like pek button so I could test a few more things. I tested all the events I added and they are in the debug log attached. There are lots of interrupts available for all the events the axp192 does by itself. If you plug in vbus you get two interrupts, one for plugging in and another for battery fully charged or battery charging depending on if its already fully charged or not.
Changing INPUT_PULLUP to INPUT was one of the last changes I made and seemed to make it reliable, before that interrupts were intermittent. The pin is definitely pulled down for an interrupt so falling is correct rather than rising, in some documentation I found mentioned that host pulls it up again after its done servicing interrupt, it seems to work ok either way.
I dont know how git works to submit changes, rather than guess and do it incorrectly I'll just post it here instead.
irq2.zip
from firmware.
@spattinson DAMN. That's awesome. I'll pull this in and merge it tomorrow (I'm in (remote) class today).
from firmware.
Related Issues (20)
- [Bug]: high power usage on Rak 4631/19003 & GNSS 12500
- [Bug]: 2.3.11 BME280 sensor temperature is too high ( Sensor Thermal Control ) #2
- [Bug]: scanning qr-code will replace configured channels HOT 1
- [Bug]: Using APP and web client: messages don't show HOT 2
- [Feature Request]: IPv6 support in Linux Native
- [Feature Request]: Change Middle button for ESP32's HOT 1
- [Bug]: Raspberry PI meshtasticd_2.3.13.a38a18d_amd64.deb doesnt recognize existing dependences HOT 5
- [Feature Request]: --request-environment HOT 3
- [Bug]: multiple Typo ... mhz -> MHz HOT 1
- [Feature Request]: Expand compatibility with RAK WisBlock Sensor Modules HOT 1
- [Feature Request]: Cancel canned message with main button HOT 2
- Add semihosting to allow debug without USB/serial
- Implement PowerMon
- [Bug]: QMC5883L Has the wrong address in the config
- [Feature Request]: Identify log data that may need privacy redaction HOT 3
- [Feature Request]: Implement ESP32 BT / WiFi RF coexistance HOT 1
- Heltec Tracker v1.1 U6 wastes power HOT 19
- [Bug]: Battery info shows 0%
- [Feature Request]: some ideas for next releases ? HOT 1
- [Feature Request]: Do not retain MQTT 'stat' topic HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firmware.