Skip to content

Commit

Permalink
update für DFMiniMp3 v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
seisfeld committed Feb 22, 2020
1 parent 73b5681 commit 2046a54
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions Tonuino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -91,29 +91,26 @@ class Mp3Notify {
Serial.print("Com Error ");
Serial.println(errorCode);
}
static void OnPlayFinished(uint16_t track) {
static void PrintlnSourceAction(DfMp3_PlaySources source, const char* action) {
if (source & DfMp3_PlaySources_Sd) Serial.print("SD Karte ");
if (source & DfMp3_PlaySources_Usb) Serial.print("USB ");
if (source & DfMp3_PlaySources_Flash) Serial.print("Flash ");
Serial.println(action);
}
static void OnPlayFinished(DfMp3_PlaySources source, uint16_t track) {
// Serial.print("Track beendet");
// Serial.println(track);
// delay(100);
nextTrack(track);
}
static void OnCardOnline(uint16_t code) {
Serial.println(F("SD Karte online "));
}
static void OnCardInserted(uint16_t code) {
Serial.println(F("SD Karte bereit "));
}
static void OnCardRemoved(uint16_t code) {
Serial.println(F("SD Karte entfernt "));
static void OnPlaySourceOnline(DfMp3_PlaySources source) {
PrintlnSourceAction(source, "online");
}
static void OnUsbOnline(uint16_t code) {
Serial.println(F("USB online "));
static void OnPlaySourceInserted(DfMp3_PlaySources source) {
PrintlnSourceAction(source, "bereit");
}
static void OnUsbInserted(uint16_t code) {
Serial.println(F("USB bereit "));
}
static void OnUsbRemoved(uint16_t code) {
Serial.println(F("USB entfernt "));
static void OnPlaySourceRemoved(DfMp3_PlaySources source) {
PrintlnSourceAction(source, "entfernt");
}
};

Expand Down Expand Up @@ -719,13 +716,13 @@ void waitForTrackToFinish() {
void setup() {

Serial.begin(115200); // Es gibt ein paar Debug Ausgaben über die serielle Schnittstelle

// Wert für randomSeed() erzeugen durch das mehrfache Sammeln von rauschenden LSBs eines offenen Analogeingangs
uint32_t ADC_LSB;
uint32_t ADCSeed;
for(uint8_t i = 0; i < 128; i++) {
for (uint8_t i = 0; i < 128; i++) {
ADC_LSB = analogRead(openAnalogPin) & 0x1;
ADCSeed ^= ADC_LSB << (i % 32);
ADCSeed ^= ADC_LSB << (i % 32);
}
randomSeed(ADCSeed); // Zufallsgenerator initialisieren

Expand Down

0 comments on commit 2046a54

Please sign in to comment.