Skip to content

Commit

Permalink
modules/bluetooth: Add reset control on BLE1507 Add-on board
Browse files Browse the repository at this point in the history
Use the reset pin instead of the power control.
The board needs to be modified to use this reset function.
  • Loading branch information
SPRESENSE committed Feb 27, 2024
1 parent 4b3713c commit f1b8ad0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions sdk/modules/bluetooth/hal/nrf52/ble_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
extern bleGapMem *bleGetGapMem(void);
extern void bleMngEvtDispatch(ble_evt_t *nrfEvt);
extern void board_nrf52_initialize(void);
extern void board_nrf52_reset(bool en);

/****************************************************************************
* Pre-processor Definitions
Expand Down Expand Up @@ -213,9 +212,12 @@ static int blePowerOff(void)
{
int ret = 0;

// for support reset pin. (Will be valid later)
// board_nrf52_reset(true);
ret = board_power_control(POWER_BTBLE, false);
/* Control the reset pin instead of the power.
* true (HIGH) : reset assert
* false (LOW) : reset deassert
*/

ret = board_power_control(POWER_BTBLE, true);
if (ret)
{
BLE_PRT("board_power_control(off): NG %d\n", ret);
Expand Down Expand Up @@ -509,18 +511,24 @@ static
int blePowerOn(void)
{
int ret = 0;
ret = board_power_control(POWER_BTBLE, true);

/* Control the reset pin instead of the power.
* true (HIGH) : reset assert
* false (LOW) : reset deassert
*/

ret = board_power_control(POWER_BTBLE, false);

if (ret)
{
BLE_PRT("board_power_control(on): NG %d\n", ret);
goto errPower;
}
// for support reset pin. (Will be valid later)
// board_nrf52_reset(false);

BLE_PRT("Power on BLE!!\n");
return BLE_SUCCESS;
errPower:
(void)board_power_control(POWER_BTBLE, false);
(void)board_power_control(POWER_BTBLE, true);
return ret;

}
Expand Down

0 comments on commit f1b8ad0

Please sign in to comment.