Exemplo n.º 1
0
// Enqueue of messages ClockTimer::timer::timer_timeout
void enqueue_ClockTimer_send_timer_timer_timeout(struct ClockTimer_Instance *_instance){
fifo_lock();
if ( fifo_byte_available() > 4 ) {

_fifo_enqueue( (1 >> 8) & 0xFF );
_fifo_enqueue( 1 & 0xFF );

// ID of the source instance
_fifo_enqueue( (_instance->id >> 8) & 0xFF );
_fifo_enqueue( _instance->id & 0xFF );
}
Exemplo n.º 2
0
// Enqueue of messages WebSMirrorServer::lifecycle::client_launched
void enqueue_WebSMirrorServer_send_lifecycle_client_launched(struct WebSMirrorServer_Instance *_instance){
fifo_lock();
if ( fifo_byte_available() > 4 ) {

_fifo_enqueue( (1 >> 8) & 0xFF );
_fifo_enqueue( 1 & 0xFF );

// ID of the source instance
_fifo_enqueue( (_instance->id >> 8) & 0xFF );
_fifo_enqueue( _instance->id & 0xFF );
}
// Enqueue of messages Sender::myPort::mEnum
void enqueue_Sender_send_myPort_mEnum(struct Sender_Instance *_instance, uint8_t p){
//[]
fifo_lock();
if ( fifo_byte_available() > 5 ) {

_fifo_enqueue( (1 >> 8) & 0xFF );
_fifo_enqueue( 1 & 0xFF );

// ID of the source instance
_fifo_enqueue( (_instance->id >> 8) & 0xFF );
_fifo_enqueue( _instance->id & 0xFF );

// parameter p
union u_p_t {
uint8_t p;
byte bytebuffer[1];
} u_p;
u_p.p = p;
_fifo_enqueue(u_p.bytebuffer[0] & 0xFF);
}
void I2Cread() {
  
  #ifdef DEBUGG
    Serial.println("[I2Cread] Start");
  #endif
  
   while (Wire.available())   // slave may send less than requested
    {
      byte b = Wire.read(); // receive a byte
      _fifo_enqueue(b);
    }
  
    #ifdef DEBUGG
      Serial.println();
      Serial.println("[I2Cread] Done ");
    #endif
  
}