Update copyright header + Arduino example indentation.

This commit is contained in:
Dennis Frett 2021-02-05 11:49:23 +01:00
parent 17cb44b5a2
commit 0d57603adb
3 changed files with 37 additions and 23 deletions

View file

@ -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
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
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
the GPL2 ("Copyleft").
Contact information
-------------------
Kristian Lauszus, TKJ Electronics
Web : http://www.tkjelectronics.com
e-mail : kristianl@tkjelectronics.com
Kristian Sloth Lauszus
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"

View file

@ -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
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
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
the GPL2 ("Copyleft").
Contact information
-------------------
Kristian Lauszus, TKJ Electronics
Web : http://www.tkjelectronics.com
e-mail : kristianl@tkjelectronics.com
Kristian Sloth Lauszus
Web : https://lauszus.com
e-mail : lauszus@gmail.com
Dennis Frett
GitHub : https://github.com/dennisfrett
e-mail : dennis.frett@live.com
*/
#pragma once

View file

@ -14,34 +14,34 @@ USB Usb;
MiniDSP MiniDSP(&Usb);
void OnMiniDSPConnected() {
Serial.println("MiniDSP connected");
Serial.println("MiniDSP connected");
}
void OnVolumeChange(uint8_t volume) {
Serial.println("Volume is: " + String(volume));
Serial.println("Volume is: " + String(volume));
}
void OnMutedChange(bool isMuted) {
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
}
void setup() {
Serial.begin(115200);
Serial.begin(115200);
#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
if(Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while(1); // Halt
}
Serial.println(F("\r\nMiniDSP 2x4HD Library Started"));
if(Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while(1); // Halt
}
Serial.println(F("\r\nMiniDSP 2x4HD Library Started"));
// Register callbacks.
MiniDSP.attachOnInit(&OnMiniDSPConnected);
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
MiniDSP.attachOnMutedChange(&OnMutedChange);
// Register callbacks.
MiniDSP.attachOnInit(&OnMiniDSPConnected);
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
MiniDSP.attachOnMutedChange(&OnMutedChange);
}
void loop() {
Usb.Task();
Usb.Task();
}