Skip to content

Commit

Permalink
Some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed Aug 8, 2024
1 parent 072bdaf commit c839ea9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/M5UnitGesture/src/unit/unit_PAJ7620U2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ bool UnitPAJ7620U2::readObjectCenter(uint16_t& x, uint16_t& y) {
}

bool UnitPAJ7620U2::readCursor(uint16_t& x, uint16_t& y) {
std::array<uint8_t, 4> raw{}; // X_LOW , 4?
// std::array<uint8_t, 4> raw{}; // X_LOW , 4?

uint8_t xl{}, xh{}, yl{}, yh{};
if (read_banked_register8(CURSOR_CLAMP_CENTER_X_LOW, xl) &&
Expand Down
5 changes: 4 additions & 1 deletion lib/M5UnitGesture/src/unit/unit_PAJ7620U2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <M5UnitComponent.hpp>
#include <m5_utility/container/circular_buffer.hpp>
#include <array>
#include <memory>

namespace m5 {
namespace unit {
Expand Down Expand Up @@ -87,6 +89,8 @@ enum class Frequency : int8_t {
@brief Measurement data group
*/
struct Data {
Data() {
}
// Common
// [0,1]:gesture
// Proximity
Expand Down Expand Up @@ -145,7 +149,6 @@ struct Data {

} // namespace paj7620u2


/*!
@class UnitPAJ7620U2
@brief PAJ7620U2 unit
Expand Down
4 changes: 3 additions & 1 deletion lib/M5UnitHeart/src/utility/heart_rate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ namespace max30100 {

HeartRate::HeartRate(const uint32_t srate, const float threshold,
const size_t max_data_size)
: _samplingRate{srate}, _threshold(threshold), _maxDataSize{max_data_size} {
: _samplingRate{(float)srate},
_threshold(threshold),
_maxDataSize{max_data_size} {
assert(srate && "SamplingRate must not be zero");
if (!max_data_size) {
_maxDataSize = (size_t)srate * 30U;
Expand Down
10 changes: 6 additions & 4 deletions test/embedded/test_scd40/scd40_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ class TestSCD40 : public ComponentTestBase<UnitSCD40, bool> {
#else
auto ptr = new m5::unit::UnitSCD40();
#endif
auto cfg = ptr->config();
cfg.start_periodic = false;
cfg.stored_size = 2;
ptr->config(cfg);
if (ptr) {
auto cfg = ptr->config();
cfg.start_periodic = false;
cfg.stored_size = 2;
ptr->config(cfg);
}
return ptr;
}
virtual bool is_using_hal() const override {
Expand Down

0 comments on commit c839ea9

Please sign in to comment.