Skip to content

Merge dev into main for v1.2.3 release#44

Merged
Sebi1128 merged 6 commits into
mainfrom
dev
Jun 21, 2026
Merged

Merge dev into main for v1.2.3 release#44
Sebi1128 merged 6 commits into
mainfrom
dev

Conversation

@Sebi1128

Copy link
Copy Markdown
Collaborator

No description provided.

Sebi1128 and others added 6 commits April 2, 2026 15:01
This change keeps backward-compatible streaming behavior for ultrasound data while making accelerometer streaming optional.

Tested the following cases:

1. accelerometer requested
   - firmware starts correctly
   - ultrasound data streams correctly
   - accelerometer data is appended to outgoing frames

2. accelerometer not requested
   - firmware starts correctly
   - ultrasound data streams correctly
   - accelerometer remains off

3. repeated configuration updates
   - switching between enabled and disabled modes works correctly
Merge pull request #38 from pulp-bio/dev
…er_readout

Feature/add optional accelerometer readout
Copilot AI review requested due to automatic review settings June 21, 2026 15:45
@Sebi1128 Sebi1128 requested a review from gspacone June 21, 2026 15:47
@Sebi1128 Sebi1128 merged commit 48a913c into main Jun 21, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the project to v1.2.3 and introduces optional IIS2DH accelerometer streaming on the nRF52 firmware, controlled via a user configuration packet received over BLE.

Changes:

  • Bump version references to v1.2.3 and add v1.2.3 changelog entries.
  • Add an IIS2DH (I2C/TWI) driver and runtime enable/disable logic driven by a decoded BLE config field.
  • Adjust SPI frame completion so IMU/non-IMU post-processing finalizes frames (rather than finalizing directly in the SPI completion ISR).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
README.md Updates displayed release version to v1.2.3.
CHANGELOG.md Adds top-level v1.2.3 entry summarizing new optional accelerometer streaming.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/CHANGELOG.md Adds firmware-specific v1.2.3 details for IIS2DH + frame finalization changes.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/us_ble.c Decodes config packets to request accel streaming; currently adds an unused IIS2DH header dependency.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/us_spi.c Switches from immediate frame finalization to IMU-post-processing signaling (flag_add_IMU).
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/main.c Applies pending accel mode updates and routes each frame through IMU/non-IMU finalization.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/iis2dh.h Introduces IIS2DH driver API and TWI instance selection.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/iis2dh.c Implements IIS2DH TWI driver and patches accel bytes into the SPI RX buffer.
fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/pca10040/s132/ses/US_probe_nRF52_firmware.emProject Adds IIS2DH source files and TWI driver sources to the SES project.
Comments suppressed due to low confidence (1)

fw/nrf52/ble_peripheral/US_probe_nRF52_firmware/us_spi.c:187

  • counter_cc0_event_handler now declares err_code/length and assigns length, but these are unused after moving frame completion to the IMU/non-IMU post-processing path. This will trigger unused-variable warnings and obscures the new control flow.
    // Relay the received SPI data to the BLE dongle
    uint32_t err_code;
    uint16_t length;

    length = BYTES_PR_XFER_RX;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 75 to +76
#include "us_defines.h"
#include "iis2dh.h"
Comment on lines +187 to +189
accel_stream_enabled = accel_stream_requested;
IIS2DH_set_streaming_enabled(accel_stream_enabled);
accel_stream_update_pending = false;
Comment on lines +53 to +58
// TWI instance ID
#if TWI0_ENABLED
#define TWI_INSTANCE_ID 0
#elif TWI1_ENABLED
#define TWI_INSTANCE_ID 1
#endif
Comment on lines +85 to +90
// Send the register address where we want to read the data from
err_code = nrf_drv_twi_tx(&IIS2DH_twi, IIS2DH_ADDRESS, &register_address, 1, true);

//Wait for the transmission to be completed
while (IIS2DH_xfer_done == false){}

Comment on lines +100 to +104
// Receive the data from the IIS2DH
err_code = nrf_drv_twi_rx(&IIS2DH_twi, IIS2DH_ADDRESS, rx_buffer, number_of_bytes);
//wait until the transmission is completed
while (IIS2DH_xfer_done == false){}

Comment on lines +213 to +214
}
}
flag_add_IMU = false;

// Zero out the 6 bytes that would normally carry accel data
uint8_t *dst = &m_rx_buf[3 + buffer_counter * NUMBER_OF_XFERS].buffer[0] + 202 - 6;
Comment on lines +309 to +311
memcpy(&m_rx_buf[3 + buffer_counter * NUMBER_OF_XFERS].buffer[0] + 202 - 6,
&IIS2DH_buffer[0],
6);


/**
* @brief TWI initialization function for the MCP9808 sensor
Comment on lines +178 to +180
// Buffer ready to add IMU data
flag_add_IMU = true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants