Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

@jimmy-huang
Copy link
Contributor

Added trigger support, since currently in Zephyr, triggers can
only be signaledfrom interrupt from x86 side, all the x86 side
code is wrapped with BUILD_MODULE_SENSOR_TRIGGER #ifdef so that
it can be turn off later when Zephyr changes.

The trigger are set to sample in 50Hz, any higher frequency
will cause the ring buffer to start dropping change events.

Signed-off-by: Jimmy Huang jimmy.huang@intel.com

Added trigger support, since currently in Zephyr, triggers can
only be signaledfrom interrupt from x86 side, all the x86 side
code is wrapped with BUILD_MODULE_SENSOR_TRIGGER #ifdef so that
it can be turn off later when Zephyr changes.

The trigger are set to sample in 50Hz, any higher frequency
will cause the ring buffer to start dropping change events.

Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
arc/src/main.c Outdated

if (sensor_channel_get(dev, SENSOR_CHAN_GYRO_ANY, val) < 0) {
ZJS_PRINT("Cannot read gyroscope channels.\n");
ZJS_PRINT("failed to read gyroscope channels.\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

remove period for consistency i guess?

arc/src/main.c Outdated
sensor_value_snprintf(buf_y, sizeof(buf_y), &val[1]);
sensor_value_snprintf(buf_z, sizeof(buf_z), &val[2]);
ZJS_PRINT("Sending gyro : X=%s, Y=%s, Z=%s\n", buf_x, buf_y, buf_z);
ZJS_PRINT("sending gyro : X=%s, Y=%s, Z=%s\n", buf_x, buf_y, buf_z);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove the space before the : like good Americans

arc/src/main.c Outdated
ZJS_PRINT("failed to initialize BMI160 sensor\n");
} else {
if (!auto_calibration(bmi160)) {
if (auto_calibration(bmi160) != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't really need the != 0, but that's just my personal preferred style, not going to enforce it. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

echo "CONFIG_GPIO_QMSI_1_PRI=2" >> prj.conf.tmp
echo "CONFIG_SPI=y" >> arc/prj.conf.tmp
echo "CONFIG_SPI_DW_ARC_AUX_REGS=y" >> arc/prj.conf.tmp
echo "CONFIG_SPI_DW_INTERRUPT_SEPARATED_LINES=y" >> arc/prj.conf.tmp
Copy link
Contributor

Choose a reason for hiding this comment

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

This GPIO and SPI here is specific to the Arduino 101 hardware, we'd eventually need to make that dependent on architecture.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do the same thing I did for UART:

if [ $BOARD = "arduino_101" ]; then

This is precisely the reason I changed the script to pass in BOARD from the Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, sounds good

Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
@grgustaf
Copy link
Contributor

+1

@grgustaf grgustaf merged commit 2a9bbc7 into intel:master Nov 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants