Obviously this could require a heavy refactoring of your code, probably Unless it's the last byte ofĪ complete message, in which case it would process the message. If a byte isĪvailable, it would buffer it and return. It would return immediately if no byte is available. A communication routine would not wait for complete messages.Is available, it would retrieve it, send a query to the next sensor It would return immediately if no reading is available. A routine reading sensors would not wait for them to respond.Preferred way of doing this would be to make sure no function ever What you intend, there certainly is a clean way of achieving the sameĮnd result: just make sure your switch statements return fast. In case of problems, debugging this may be harder than just testing theĮxpression inside every slow function you have.Īddendum: Although I am saying that there is no clean way of doing
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |