k8055m_flush, k8055m_set_auto_flush, k8055m_get_auto_flush -- k8055-pic18f HID protocol auto flush feature
k8055-pic18f access library
#include "k8055m.h" int k8055m_flush(int cardNumber); int k8055m_set_auto_flush(int cardNumber, int flag); int k8055m_get_auto_flush(int cardNumber);
The k8055-pic18f board uses the USB HID protocol, to communicate with the host computer.
This imposes a limit of 1000 command messages per second. Rapid changes in output states
can therefore cause an IO bottleneck.
The k8055-pic18f access library maintains an in-memory status of what a connected card's
output ports "should" currently look like. All output related functions will modify that
data. k8055m_flush() will transmit that new status to the card in an actual HID
command message. If the auto-flush feature is enabled (which it is by default), then every
call to an output function will cause an implicit call to k8055m_flush().
To optimize the response time of the k8055-pic18f, a program should either use
k8055m_set_output() to cause all desired changes at once, or turn off the auto-flush
feature, call multiple output functions, then call k8055m_flush() to execute them.
k8055m_flush() and k8055m_set_auto_flush() return 0 on success, -1 on error. k8055m_get_auto_flush() returns the current auto-flush setting or -1 on error.