Skip to content

Commit 609b8b7

Browse files
committed
formatter got each file; added doxygen headers via co-pilot to h file -> to support doxygen docs in repo
1 parent a83b187 commit 609b8b7

File tree

2 files changed

+345
-112
lines changed

2 files changed

+345
-112
lines changed

src/SparkFun_MY1690_MP3_Library.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
/*
2-
This is a library written for the MY1690 Serial MP3 player
3-
SparkFun sells these at its website: www.sparkfun.com
4-
Do you like this library? Help support SparkFun. Buy a board!
5-
https://www.sparkfun.com/products/15050
6-
7-
https://github.com/sparkfun/SparkFun_MY1690_MP3_Decoder_Arduino_Library
8-
9-
This program is distributed in the hope that it will be useful,
10-
but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
GNU General Public License for more details.
13-
14-
You should have received a copy of the GNU General Public License
15-
along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
*/
17-
1+
/*!
2+
* @file SparkFun_MY1690_MP3_Library.cpp
3+
* @brief This is a library written for the MY1690 Serial MP3 player
4+
*
5+
* SparkFun sells these at its website: www.sparkfun.com
6+
*
7+
* Do you like this library? Help support SparkFun. Buy a board!
8+
* https://www.sparkfun.com/products/15050
9+
*
10+
* https://github.com/sparkfun/SparkFun_MY1690_MP3_Decoder_Arduino_Library
11+
*
12+
* @author SparkFun Electronics
13+
* @date 2024
14+
* @copyright Copyright (c) 2025, SparkFun Electronics Inc. This project is released under the MIT License.
15+
*
16+
* SPDX-License-Identifier: MIT
17+
*/
1818
#include "SparkFun_MY1690_MP3_Library.h"
1919

2020
MY1690::MY1690()
@@ -49,20 +49,20 @@ uint16_t MY1690::getVersion(void)
4949

5050
// Sometimes it responds with 'OK1.1\r\n'
5151
sendCommand(1);
52-
if(getStringResponse("OK1.1\r\n") == true)
52+
if (getStringResponse("OK1.1\r\n") == true)
5353
return (101);
5454

5555
// Sometimes it responds with '1.1\r\n'
5656
sendCommand(1);
57-
if(getStringResponse("1.1\r\n") == true)
57+
if (getStringResponse("1.1\r\n") == true)
5858
return (101);
5959

6060
sendCommand(1);
61-
if(getStringResponse("OK1.0\r\n") == true)
61+
if (getStringResponse("OK1.0\r\n") == true)
6262
return (100);
6363

6464
sendCommand(1);
65-
if(getStringResponse("1.0\r\n") == true)
65+
if (getStringResponse("1.0\r\n") == true)
6666
return (100);
6767

6868
sendCommand(1);
@@ -170,7 +170,7 @@ bool MY1690::setVolume(uint8_t volumeLevel)
170170
{
171171
// Any number above 30 will be automatically set to 30 by MY1690
172172
// Trim value so return is true
173-
if(volumeLevel > 30)
173+
if (volumeLevel > 30)
174174
volumeLevel = 30;
175175

176176
commandBytes[0] = MP3_COMMAND_SET_VOLUME;
@@ -290,15 +290,15 @@ bool MY1690::playPrevious(void)
290290
// If a song is playing, then ~14ms later 'STOP' is reported
291291
bool MY1690::stopPlaying(void)
292292
{
293-
//Use hardware pins or software command
293+
// Use hardware pins or software command
294294
if (isPlaying() == false)
295295
return (true);
296296

297297
commandBytes[0] = MP3_COMMAND_STOP;
298298
sendCommand(1);
299-
300-
//v1.1 doesn't respond with OK or STOP, instead the isPlaying can be used
301-
//getOKResponse();
299+
300+
// v1.1 doesn't respond with OK or STOP, instead the isPlaying can be used
301+
// getOKResponse();
302302

303303
delay(10); // IC takes 5ms to stop a track
304304

@@ -369,17 +369,17 @@ uint16_t MY1690::getNumberResponse(void)
369369
}
370370
else if (i <= (3 + okResponseOffset))
371371
{
372-
//Added because getVersion response is three characters long
373-
if (incoming != '\r' && incoming != '\n')
372+
// Added because getVersion response is three characters long
373+
if (incoming != '\r' && incoming != '\n')
374374
{
375-
// Convert ASCII HEX values to decimal
376-
responseValue <<= 4;
377-
if (incoming >= '0' && incoming <= '9')
378-
responseValue += (incoming - '0');
379-
else if (incoming >= 'A' && incoming <= 'Z')
380-
responseValue += (incoming - 'A') + 10;
381-
else if (incoming >= 'a' && incoming <= 'z')
382-
responseValue += (incoming - 'a') + 10;
375+
// Convert ASCII HEX values to decimal
376+
responseValue <<= 4;
377+
if (incoming >= '0' && incoming <= '9')
378+
responseValue += (incoming - '0');
379+
else if (incoming >= 'A' && incoming <= 'Z')
380+
responseValue += (incoming - 'A') + 10;
381+
else if (incoming >= 'a' && incoming <= 'z')
382+
responseValue += (incoming - 'a') + 10;
383383
}
384384
}
385385
else if (incoming == '\n')

0 commit comments

Comments
 (0)