Skip to content

Commit 39066a5

Browse files
committed
code cleanup
1 parent 6fb6a97 commit 39066a5

File tree

8 files changed

+17
-48
lines changed

8 files changed

+17
-48
lines changed

examples/Example_01_BasicReadings/Example_01_BasicReadings.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Serial.print it out at 115200 baud to serial monitor.
2222
2323
Feel like supporting our work? Buy a board from SparkFun!
24-
https://www.sparkfun.com/products/?????
24+
https://www.sparkfun.com/products/26554
2525
*/
2626

2727
#include "SparkFun_BMV080_Arduino_Library.h" // CTRL+Click here to get the library: http://librarymanager/All#SparkFun_BMV080

examples/Example_02_DutyCycle/Example_02_DutyCycle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Serial.print it out at 115200 baud to serial monitor.
2222
2323
Feel like supporting our work? Buy a board from SparkFun!
24-
https://www.sparkfun.com/products/?????
24+
https://www.sparkfun.com/products/26554
2525
*/
2626

2727
#include <Wire.h>

examples/Example_03_Interrupt/Example_03_Interrupt.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
Serial.print it out at 115200 baud to serial monitor.
2626
2727
Feel like supporting our work? Buy a board from SparkFun!
28-
https://www.sparkfun.com/products/?????
28+
https://www.sparkfun.com/products/26554
2929
*/
3030

3131
#include <Wire.h>

examples/Example_04_SPI/Example_04_SPI.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Serial.print it out at 115200 baud to serial monitor.
3030
3131
Feel like supporting our work? Buy a board from SparkFun!
32-
https://www.sparkfun.com/products/?????
32+
https://www.sparkfun.com/products/26554
3333
*/
3434

3535
#include <Wire.h>

examples/Example_05_Parameters/Example_05_Parameters.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Serial.print it out at 115200 baud to serial monitor.
3232
3333
Feel like supporting our work? Buy a board from SparkFun!
34-
https://www.sparkfun.com/products/?????
34+
https://www.sparkfun.com/products/26554
3535
*/
3636

3737
#include <Wire.h>

keywords.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
# Class
55
#########################################################
66

7-
Bmv080 KEYWORD1
7+
SparkFunBMV080I2C KEYWORD1
8+
SparkFunBMV080SPI KEYWORD1
89

910
#########################################################
1011
# Methods and Functions
1112
#########################################################
1213

1314
begin KEYWORD2
1415
init KEYWORD2
15-
initSPI KEYWORD2
1616
isConnected KEYWORD2
1717
getDriverVersion KEYWORD2
1818
open KEYWORD2
19-
openSPI KEYWORD2
2019
reset KEYWORD2
2120
getID KEYWORD2
2221
setMode KEYWORD2

src/SparkFun_BMV080_Arduino_Library.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
by Pete Lewis @SparkFun Electronics
66
September 2024
77
8-
Based on original source code written by
9-
Fischer Moseley @ SparkFun Electronics
10-
Original Creation Date: July 24, 2019
11-
128
This file implements the BMV080 class, prototyped in SparkFun_BMV080_Arduino_Library.h
139
1410
Development environment specifics:
@@ -25,12 +21,9 @@
2521

2622
#pragma once
2723

28-
// TODO: Add includes as needed (e.g. #include <Wire.h>, #include <SPI.h>)
2924
#include "sfeBmv080.h"
3025
#include <SparkFun_Toolkit.h>
3126

32-
// #include "Arduino.h"
33-
3427
// The BMV080 Bosch API requires a larger than usual stack size
3528
// In particular, bmv080_serve_interrupt is the culprit.
3629
SET_LOOP_TASK_STACK_SIZE(60 * 1024); // 60KB

src/sfeBmv080.cpp

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
/******************************************************************************
2-
sfeQwiicBuzzer.h
3-
SparkFun Qwiic Buzzer Library header file
2+
sfeBmv080.cpp
3+
SparkFun BMV080 Library CPP file
44
55
by Pete Lewis @SparkFun Electronics
6-
January 2024
7-
8-
Based on original source code written by
9-
Fischer Moseley @ SparkFun Electronics
10-
Original Creation Date: July 24, 2019
6+
September 2024
117
128
Development environment specifics:
13-
IDE: Arduino 2.2.1
14-
Hardware Platform: Arduino Uno/SparkFun Redboard
15-
Qwiic Buzzer Version: v10
9+
IDE: Arduino 2.3.3
10+
Hardware Platform: SparkFun IoT Redboard ESP32
11+
BMV080 Breakout HW Version: v01
1612
1713
SPDX-License-Identifier: MIT
1814
19-
Copyright (c) 2023 SparkFun Electronics
15+
Copyright (c) 2024 SparkFun Electronics
2016
2117
Distributed as-is; no warranty is given.
2218
******************************************************************************/
@@ -67,8 +63,8 @@ extern "C"
6763
// Get our sparkfun toolkit bus object/interface
6864
sfeTkIBus *theBus = (sfeTkIBus *)handle;
6965

70-
if(theBus->type() == kBusTypeI2C)
71-
header = header << 1; // I2C specific shift
66+
if(theBus->type() == kBusTypeI2C) // I2C specific shift
67+
header = header << 1;
7268

7369
sfeTkError_t rc = theBus->readRegister(header, payload, payload_length, nRead);
7470

@@ -113,21 +109,7 @@ extern "C"
113109
/* Custom function for consuming sensor readings */
114110
static void use_sensor_output(bmv080_output_t bmv080_output, void *callback_parameters)
115111
{
116-
// data_ready_callback_count += 1;
117-
// print_function_t print = (print_function_t)callback_parameters;
118-
119112
((sfeBmv080 *)callback_parameters)->setSensorValue(bmv080_output);
120-
121-
// Serial.println(bmv080_output.pm2_5);
122-
123-
// Serial.println("u");
124-
125-
// sfeBmv080::_sensorValue.pm2_5 = bmv080_output.pm2_5; // update the class variable with the new PM2.5 value
126-
// setSensorValue(bmv080_output.pm2_5);
127-
// sensorValue.pm2_5 = bmv080_output.pm2_5;
128-
// print("Runtime: %.2f s, PM2.5: %.0f ug/m^3, obstructed: %s, outside detection limits: %s\r\n",
129-
// bmv080_output.runtime_in_sec, bmv080_output.pm2_5, (bmv080_output.is_obstructed ? "yes" : "no"),
130-
// (bmv080_output.is_outside_detection_limits ? "yes" : "no"));
131113
}
132114

133115
static void bmv080_service_routine(const bmv080_handle_t handle, void *callback_parameters)
@@ -237,11 +219,6 @@ bool sfeBmv080::open()
237219
// Open the device - pass in the data read, data write and delay functions callbacks. Note - the "secrom_handle_t"
238220
// is just a pointer to our Tookkit communication bus objects
239221

240-
// When sending a sercom handle of SPI to bmv_open, the pointer must be a struct that includes both the SPI port (instance) and the Settings
241-
// This is because the Bosch API needs to know the SPI port and the settings for the SPI port
242-
243-
244-
245222
bmv080_status_code_t status =
246223
bmv080_open(&bmv080_handle_class, (bmv080_sercom_handle_t)_theBus, (bmv080_callback_read_t)device_read_16bit_CB,
247224
(bmv080_callback_write_t)device_write_16bit_CB, (bmv080_callback_delay_t)device_delay_CB);
@@ -499,4 +476,4 @@ bool sfeBmv080::setDoVibrationFiltering(bool do_vibration_filtering)
499476
{
500477
return true;
501478
}
502-
}
479+
}

0 commit comments

Comments
 (0)