B4R Question UInt array inline c

mzsoft

Member
hi i need to get array in line c but error.
i used (uint*)b4r_main::_irarray->data=rawCodes;.
thanks

B4X:
Sub Process_Globals
    Dim irarray(500) As UInt
End Sub


#if C

uint16_t rawCodes[100];


void storeCode(decode_results *results) {
  codeType = results->decode_type;
  int k;
    codeLen = results->rawlen - 1;
    // To store raw codes:
    // Drop first value (gap)
     Serial.println("Received unknown code, saving as raw");
    // Convert from ticks to microseconds
    // Tweak marks shorter, and spaces longer to cancel out IR receiver distortion
    for (int i = 1; i <= codeLen; i++) {
      if (i % 2) {
        // Mark
       rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK - MARK_EXCESS;
        Serial.print(" m");
      }
      else {
        // Space
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK + MARK_EXCESS;
        Serial.print(" s");
      }
      Serial.print(rawCodes[i - 1], DEC);
    }
    Serial.println("");
    

  (uint*)b4r_main::_irarray->data=rawCodes;

}

#end if
 
Top