ArduinoCore-stm32l0 icon indicating copy to clipboard operation
ArduinoCore-stm32l0 copied to clipboard

TLera Long Cricket

Open MartinNel opened this issue 5 years ago • 3 comments

Can you provide an entry in the boards.txt file for the new Long Cricket from Tlere Corp? Eg: XXXXX.build.board=STM32L0_LONG_CRICKET

We try to get our code to be source code compatible for most of the Tlere Corp devices and it would help if we could distinguish this board from the other boards using a #ifdef like for the other boards (eg ARDUINO_STM32L0_CICADA, ARDUINO_STM32L0_CRICKET and ARDUINO_STM32L0_GNAT)

MartinNel avatar Jan 14 '19 11:01 MartinNel

Currently "Long Cricket" and "Cricket" are both handled by the same "Cricket" variant. The code internally figures out whether it's a BMA280 or BMA400 on board to get the different mapping done.

I see why you'd want a separate variant thought.

GrumpyOldPizza avatar Jan 14 '19 12:01 GrumpyOldPizza

For example:

` #if defined ARDUINO_STM32L0_CICADA || defined ARDUINO_STM32L0_CRICKET

// Sampling
float Vbat = STM32L0.getVBAT();     

#elif defined ARDUINO_STM32L0_GNAT || defined ARDUINO_STM32L0_LONG_CRICKET

// Opens FETs during sampling 
digitalWrite(PIN_BAT_MEAS_CTRL,HIGH);
float Vbat = 1.27f * STM32L0.getVDDA() * ((float) analogRead(PIN_BAT_DIVIDER)) / 1024.0f;
digitalWrite(PIN_BAT_MEAS_CTRL,LOW);
     

#endif `

MartinNel avatar Jan 15 '19 13:01 MartinNel

The why is understood. I will add a variant.

GrumpyOldPizza avatar Jan 15 '19 14:01 GrumpyOldPizza