controller, added hardware lock on each calling function that accesses hardware, to ensure that hardware is only accessed from one thread at a time