Vafo / ESTC-project

ESTC Main Project
0 stars 0 forks source link

Implement message/events #23

Closed Vafo closed 1 year ago

Vafo commented 1 year ago

Busy loop goes through messages, that were generated externally

Vafo commented 1 year ago

Events are:

Vafo commented 1 year ago

Events differ by priority

  1. High
  2. Medium
  3. Low
Vafo commented 1 year ago

General idea is that user plugs functions to these events (wiki), and once event takes place, it just invokes every associated function. However, the problem is if there is any function that goes into busy looping (e.g. in workshop5), how to make it leave once other event happens? How to stop them in general?

At first glance it seems to me that there should be 2 kinds of event handling: immediate and postponed. So maybe immediate would just "turn off" appropriate flag, upon which the busy loop depends?

Vafo commented 1 year ago

Currently, I believe better solution would be to implement general message module, which would allow user to enqueue & dequeue custom events (enums), and maybe to execute something immediately on enqueue (flags that stop busy loops)

It is up to user of module to decide how to trigger the events (clicks & other interrupts)

Vafo commented 1 year ago

Also a message should contain stack allocated type msg, with fields: