fix multithread logic in template app, update gpio HAL (#250)

* fix multithread logic
* more buffer for dallas id string
* update apps to use new logic
* delay_us small speedup
* add consant qualifier to gpio records and some core api
* fix some apps to use simpler method of getting gpio record
* fix ibutton app, stupid stack problem
This commit is contained in:
DrZlo13
2020-11-19 15:25:32 +03:00
committed by GitHub
parent ccd40497eb
commit a96f23af9b
24 changed files with 137 additions and 88 deletions

View File

@@ -21,7 +21,7 @@ public:
// state initializer
AppExampleState() {
example_data = 12;
example_data = 0;
}
};
@@ -51,6 +51,16 @@ public:
// start app
void AppExample::run() {
// here we dont need to acquire or release state
// because before we call app_ready our application is "single threaded"
state.example_data = 12;
// signal that we ready to render and ipc
app_ready();
// from here, any data that pass in render function must be guarded
// by calling acquire_state and release_state
AppExampleEvent event;
while(1) {
if(get_event(&event, 1000)) {