Question
Bug in STSW-S2LP-DK in S2LP_Library in S2LP_Csma.c
There is a bug in S2LP_Library which is part of the STSW-S2LP-DK package. In the following function you need to shift xCcaLength to the upper nibble, but there is no shift in currently available version. The bug won't allow you to set CCA length.
Please fix that in next STSW-S2LP-DK release.
/**
* @brief Set the CCA length.
* @param xCcaLength the CCA length (a value between 1 and 15 that multiplies the CCA period).
* This parameter can be any value of @ref CsmaLength.
* @retval None.
*/
void S2LPCsmaSetCcaLength(uint8_t xCcaLength)
{
uint8_t tmp;
s_assert_param(IS_CSMA_LENGTH(xCcaLength));
S2LPSpiReadRegisters(CSMA_CONF0_ADDR, 1, &tmp);
tmp &= ~CCA_LEN_REGMASK;
tmp |= (xCcaLength << 4);
*(uint8_t*)&g_xStatus = S2LPSpiWriteRegisters(CSMA_CONF0_ADDR, 1, &tmp);
}