mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Update copyright header + Arduino example indentation.
This commit is contained in:
parent
17cb44b5a2
commit
0d57603adb
3 changed files with 37 additions and 23 deletions
15
MiniDSP.cpp
15
MiniDSP.cpp
|
@ -1,15 +1,22 @@
|
||||||
/* Copyright (C) 2014 Kristian Lauszus, TKJ Electronics. All rights reserved.
|
/* Copyright (C) 2020 Kristian Sloth Lauszus and Dennis Frett. All rights reserved.
|
||||||
|
|
||||||
This software may be distributed and modified under the terms of the GNU
|
This software may be distributed and modified under the terms of the GNU
|
||||||
General Public License version 2 (GPL2) as published by the Free Software
|
General Public License version 2 (GPL2) as published by the Free Software
|
||||||
Foundation and appearing in the file GPL2.TXT included in the packaging of
|
Foundation and appearing in the file GPL2.TXT included in the packaging of
|
||||||
this file. Please note that GPL2 Section 2[b] requires that all works based
|
this file. Please note that GPL2 Section 2[b] requires that all works based
|
||||||
on this software must also be made publicly available under the terms of
|
on this software must also be made publicly available under the terms of
|
||||||
the GPL2 ("Copyleft").
|
the GPL2 ("Copyleft").
|
||||||
|
|
||||||
Contact information
|
Contact information
|
||||||
-------------------
|
-------------------
|
||||||
Kristian Lauszus, TKJ Electronics
|
|
||||||
Web : http://www.tkjelectronics.com
|
Kristian Sloth Lauszus
|
||||||
e-mail : kristianl@tkjelectronics.com
|
Web : https://lauszus.com
|
||||||
|
e-mail : lauszus@gmail.com
|
||||||
|
|
||||||
|
Dennis Frett
|
||||||
|
GitHub : https://github.com/dennisfrett
|
||||||
|
e-mail : dennis.frett@live.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MiniDSP.h"
|
#include "MiniDSP.h"
|
||||||
|
|
15
MiniDSP.h
15
MiniDSP.h
|
@ -1,15 +1,22 @@
|
||||||
/* Copyright (C) 2014 Kristian Lauszus, TKJ Electronics. All rights reserved.
|
/* Copyright (C) 2020 Kristian Sloth Lauszus and Dennis Frett. All rights reserved.
|
||||||
|
|
||||||
This software may be distributed and modified under the terms of the GNU
|
This software may be distributed and modified under the terms of the GNU
|
||||||
General Public License version 2 (GPL2) as published by the Free Software
|
General Public License version 2 (GPL2) as published by the Free Software
|
||||||
Foundation and appearing in the file GPL2.TXT included in the packaging of
|
Foundation and appearing in the file GPL2.TXT included in the packaging of
|
||||||
this file. Please note that GPL2 Section 2[b] requires that all works based
|
this file. Please note that GPL2 Section 2[b] requires that all works based
|
||||||
on this software must also be made publicly available under the terms of
|
on this software must also be made publicly available under the terms of
|
||||||
the GPL2 ("Copyleft").
|
the GPL2 ("Copyleft").
|
||||||
|
|
||||||
Contact information
|
Contact information
|
||||||
-------------------
|
-------------------
|
||||||
Kristian Lauszus, TKJ Electronics
|
|
||||||
Web : http://www.tkjelectronics.com
|
Kristian Sloth Lauszus
|
||||||
e-mail : kristianl@tkjelectronics.com
|
Web : https://lauszus.com
|
||||||
|
e-mail : lauszus@gmail.com
|
||||||
|
|
||||||
|
Dennis Frett
|
||||||
|
GitHub : https://github.com/dennisfrett
|
||||||
|
e-mail : dennis.frett@live.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
|
@ -14,34 +14,34 @@ USB Usb;
|
||||||
MiniDSP MiniDSP(&Usb);
|
MiniDSP MiniDSP(&Usb);
|
||||||
|
|
||||||
void OnMiniDSPConnected() {
|
void OnMiniDSPConnected() {
|
||||||
Serial.println("MiniDSP connected");
|
Serial.println("MiniDSP connected");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnVolumeChange(uint8_t volume) {
|
void OnVolumeChange(uint8_t volume) {
|
||||||
Serial.println("Volume is: " + String(volume));
|
Serial.println("Volume is: " + String(volume));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMutedChange(bool isMuted) {
|
void OnMutedChange(bool isMuted) {
|
||||||
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
|
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
#if !defined(__MIPSEL__)
|
#if !defined(__MIPSEL__)
|
||||||
while(!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
|
while(!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
|
||||||
#endif
|
#endif
|
||||||
if(Usb.Init() == -1) {
|
if(Usb.Init() == -1) {
|
||||||
Serial.print(F("\r\nOSC did not start"));
|
Serial.print(F("\r\nOSC did not start"));
|
||||||
while(1); // Halt
|
while(1); // Halt
|
||||||
}
|
}
|
||||||
Serial.println(F("\r\nMiniDSP 2x4HD Library Started"));
|
Serial.println(F("\r\nMiniDSP 2x4HD Library Started"));
|
||||||
|
|
||||||
// Register callbacks.
|
// Register callbacks.
|
||||||
MiniDSP.attachOnInit(&OnMiniDSPConnected);
|
MiniDSP.attachOnInit(&OnMiniDSPConnected);
|
||||||
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
|
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
|
||||||
MiniDSP.attachOnMutedChange(&OnMutedChange);
|
MiniDSP.attachOnMutedChange(&OnMutedChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Usb.Task();
|
Usb.Task();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue