You are reading a single comment by @Frida and its replies. Click here to read the full conversation.
  • Well now I success. I found the error in:
    Espruino-master/targets/stm32/jshardware­.c, downloaded today.
    It say's espruino_1v72_stm32f3discovery.bin when compiled.

    I have changed the following lines:

    static ALWAYS_INLINE uint8_t pinToEVEXTI(Pin ipin) {
      JsvPinInfoPin pin = pinInfo[ipin].pin;
      return (uint8_t)(EV_EXTI0+pin); // PB
    //  return (uint8_t)(EV_EXTI0+(pin-JSH_PIN0));
    
    static ALWAYS_INLINE uint16_t stmPin(Pin ipin) {
      JsvPinInfoPin pin = pinInfo[ipin].pin;
      return (uint16_t)(1 << pin); // PB
    //  return (uint16_t)(1 << (pin-JSH_PIN0));
    
    static ALWAYS_INLINE uint32_t stmExtI(Pin ipin) {
      JsvPinInfoPin pin = pinInfo[ipin].pin;
      return (uint32_t)(pin); // PB
    //  return (uint32_t)(1 << (pin-JSH_PIN0));
    
    static ALWAYS_INLINE uint8_t stmPinSource(JsvPinInfoPin ipin) {
      JsvPinInfoPin pin = pinInfo[ipin].pin;
      return (uint8_t)(pin); // PB
    //  return (uint8_t)(pin-JSH_PIN0);
    

    The fault is in section 3: it vent 1,2,4 and should be 0,1,2.
    At the same time I removed JSH_PIN0, because it is 0, and something - 0 gives something. That saved me 24 bytes.
    I don't know what it else have influence on.

    I hope you can integrate it in the next version.
    C is difficult I must say.

About

Avatar for Frida @Frida started