the events is there to check if theres any messages from queue, if its not called, the master wouldnt know items are available. an empty queue sends a notmal 4 dword confirmation message back to master to drop line
if you have another suggestion, let me know. If you want a dedicated GPIO for an "interrupt" simulation, sortof, we could have the slave signal a line HIGH that master sees theres data, and it will stay high until all of its items dequeue, then events() could stop processing until the line goes HIGH again, the interrupt would be on master, but i do believe you dont need an "interrupt" as you could poll that pin in normal loop. However, If we do add "interrupt" capability, we could also have pass-through interrupts some way or another from the slave's IO pins, a design decision will need to go into that before we start writing the code
Also, I think we should set the queue array limit same as
so:
Why stop there, heres the update:
if you have another suggestion, let me know. If you want a dedicated GPIO for an "interrupt" simulation, sortof, we could have the slave signal a line HIGH that master sees theres data, and it will stay high until all of its items dequeue, then events() could stop processing until the line goes HIGH again, the interrupt would be on master, but i do believe you dont need an "interrupt" as you could poll that pin in normal loop. However, If we do add "interrupt" capability, we could also have pass-through interrupts some way or another from the slave's IO pins, a design decision will need to go into that before we start writing the code
Also, I think we should set the queue array limit same as
Code:
#define DATA_BUFFER_MAX 200
so:
Code:
static Circular_Buffer<uint16_t, 12, DATA_BUFFER_MAX> mtsca;
static Circular_Buffer<uint16_t, 12, DATA_BUFFER_MAX> stmca;
Why stop there, heres the update:
Code:
#define DATA_BUFFER_MAX 200
#define QUEUE_SLOTS 12
Code:
static Circular_Buffer<uint16_t, QUEUE_SLOTS, DATA_BUFFER_MAX> mtsca;
static Circular_Buffer<uint16_t, QUEUE_SLOTS, DATA_BUFFER_MAX> stmca;