You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • I don't think I2C2 is supported on Espruino since you can't have two SPI and two I2C.

    oh, I see, I was confused by the board file having

      'spi' : 3,
      'i2c' : 2,
      'adc' : 1,
    

    and I2C2 being defined. But since there are 3 SPIs too and the i2c/spi resources are shared it clearly cannot work for all five at the same time even if those objects are all defined in the interpreter, however I did not use SPI yet so in theory both i2c interfaces should be free to use.

    Thanks for pointing the inverting code (would not have guessed it is done later at runtime), also will try with 'make clean', thanks.
    EDIT: oh, checked the file you linked and the answer to SPI/I2c is there too
    https://github.com/espruino/Espruino/blo­b/master/targets/nrf5x/jshardware.c#L75
    so currently just one SPI and one I2c. So perhaps the board file should reflect that if those numbers have any efffect on generating those SPIx and I2Cx objects at runtime.
    EDIT2: and indeed they have, I have reduced i2c and spi to 1 and jswrapper.c no longer has those not supported ones generated.

About

Avatar for fanoush @fanoush started