Skip to content

Commit a71377a

Browse files
committed
[driver] Move QMC5883 driver into modm namespace
1 parent 211f24e commit a71377a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

examples/avr/qmc5883l/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using namespace Board;
1818
using namespace std::chrono_literals;
1919

20-
using Compass = Qmc5883l<I2cMaster>;
20+
using Compass = modm::Qmc5883l<I2cMaster>;
2121
Compass::Data data;
2222
Compass compass(data);
2323
modm::atomic::Flag dataReady(true);

src/modm/driver/inertial/qmc5883l.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
/*
2+
* Copyright (c) 2023, Alexander Solovets
3+
*
4+
* This file is part of the modm project.
5+
*
6+
* This Source Code Form is subject to the terms of the Mozilla Public
7+
* License, v. 2.0. If a copy of the MPL was not distributed with this
8+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
*/
10+
// ----------------------------------------------------------------------------
11+
112
#pragma once
213

314
#include <algorithm>
415
#include <modm/architecture/interface/i2c_device.hpp>
516
#include <modm/architecture/interface/register.hpp>
617
#include <modm/math/utils/endianness.hpp>
718

19+
namespace modm
20+
{
21+
822
template<typename I2cMaster>
923
class Qmc5883l;
1024

@@ -124,7 +138,7 @@ struct Qmc5883lRegisters
124138
};
125139

126140
template<class I2cMaster>
127-
class Qmc5883l : public Qmc5883lRegisters, public modm::I2cDevice<I2cMaster>
141+
class Qmc5883l : public Qmc5883lRegisters, public I2cDevice<I2cMaster>
128142
{
129143
/// @cond
130144
Data &data;
@@ -186,3 +200,5 @@ class Qmc5883l : public Qmc5883lRegisters, public modm::I2cDevice<I2cMaster>
186200
return false;
187201
}
188202
};
203+
204+
} // namespace modm

0 commit comments

Comments
 (0)