Am Dienstag, den 31.01.2017, 08:51 +0000 schrieb Tristan Williams: > Hello Matthias, > > Thank you. >rx-buf is wonderful. I have high hopes of making the > keypad appear as a subset of the keyboard so they can use exactly the > same code. > > The PCF8574A + keypad + interrupt also seems to work well. I > explicitly protected each of the other i2c devices on the bus from > being interrupted (by the keypress interrupt) at inopportune moments > using critical[ <code> ]critical. Without this I would (eventually) > crash the system with a -4000 error. I thought about protecting all > the i2c devices en masse at a lower level e.g. > > : i2c.c! > critical[ > i2c.begin > <code> > i2c.end > ]critical > ; > > or is this just a bad idea?
Not at all. I'd suggest using semaphores that make sure a reservation for the I2C bus is in place (or not). critical[] is probably too much and too restrictive. Semaphores would be useful for other things like the pictured numeric output buffer (aka HOLD and the group of # words) too. Matthias ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel