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)
- [Feature Request]: Request node info when not in node list and message delivered HOT 1
- [Bug]: PicoW Hardware Firmware Crash On Bad Packet HOT 1
- [Bug]: ESP32 goes into error after uploading VS CODE HOT 17
- [Feature Request]: Regulatory gain setting for BLE HOT 6
- [Bug]: LILYGO Lora V2.1-1.6 does not shutdown on 0% battery HOT 1
- [Feature Request]: Proposal of new role HOT 2
- [Feature Request]: Increase of speed
- [Feature Request]: Templates for custom boards HOT 2
- [Bug]: M5 Stack firmware not working with ESP32-S3 version of the M5 Stack
- Request for new definition to support Ebyte E22 modules[Board]: HOT 1
- [Bug]: Triple-click behaviour for GPS doesn't work as expected HOT 1
- [Feature Request]: Option to limit traffic based on original hop settings HOT 6
- [Bug]: rak4631 shutting down from keypress that never happened HOT 4
- [Feature Request]: Setting to configure a periodic reboot HOT 6
- [Feature Request]: Report altitude from pressure HOT 5
- [Feature Request]: Use DOP from GPS devices to determine if we have a good enough position to save airtime HOT 1
- [Bug]: No way to change recipient when typing message on T-Deck HOT 1
- [Board]: Flipper zero (with Lora module) HOT 2
- [Bug]: PicoW GPS Firmware HOT 1
- [Feature Request]: Add a module for "Device intrusion" HOT 1
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.