Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Release 1.0.0 #18

Merged
merged 3 commits into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// to add license
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2005-2013 Arduino Team. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

/*
* Arduino srl
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/* UART handler declaration */
UART_HandleTypeDef UartHandle;

HardwareSerial Serial0(UART4_dev);
HardwareSerial Serial(UART4_dev);//Serial0(UART4_dev);
HardwareSerial Serial1(USART3_dev);
HardwareSerial Serial2(USART2_dev);
HardwareSerial Serial3(USART6_dev);
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class HardwareSerial : public Stream {
uint8 rx_pin;
};

extern HardwareSerial Serial0;
extern HardwareSerial Serial;//Serial0;
extern HardwareSerial Serial1;
extern HardwareSerial Serial2;
extern HardwareSerial Serial3;
Expand Down
5 changes: 5 additions & 0 deletions cores/arduino/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
* published by the Free Software Foundation.
*/

/*
* Arduino srl - www.arduino.org
* 2016 Jun 9: Edited Francesco Alessi (alfran) - [email protected]
*/

#ifndef _SPI_H_INCLUDED
#define _SPI_H_INCLUDED

Expand Down
1 change: 0 additions & 1 deletion cores/arduino/WCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#ifndef Character_h
#define Character_h
//ciao
#include <ctype.h>

// WCharacter.h prototypes
Expand Down
3 changes: 1 addition & 2 deletions cores/arduino/dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void dac_init(const dac_dev *dev, uint32 flags) {
* DAC_CH1: Select channel 1
* DAC_CH2: Select channel 2
* @param status Status:
* 1: enable buffer
* 1: enable buffer
* 0: disable buffer
*/
void dac_enable_buffer(const dac_dev *dev, uint32 flags, int status) {
Expand Down Expand Up @@ -124,7 +124,6 @@ void dac_write_channel(const dac_dev *dev, uint8 channel, uint16 val) {
* @brief Enable a DAC channel
* @param dev DAC device
* @param channel channel to enable, either 1 or 2
* @sideeffect May change pin mode of PA4 or PA5
*/
void dac_enable_channel(const dac_dev *dev, uint8 channel) {
/*
Expand Down
19 changes: 18 additions & 1 deletion cores/arduino/delay.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
Copyright (c) 2014 Arduino. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
* @file delay.h
* @brief Delay implementation
Expand Down Expand Up @@ -41,4 +59,3 @@ static inline void delay_ns100(uint32 us) {
: "r0");
}
#endif

5 changes: 1 addition & 4 deletions cores/arduino/rcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void InitMCO1()
gpio_set_mode(GPIOA_dev, 8, GPIO_MODE_AF | GPIO_OTYPE_PP | GPIO_OSPEED_100MHZ);
}

void SetupClock() // to be setted properly
void SetupClock()
{

RCC_ClkInitTypeDef RCC_ClkInitStruct;
Expand Down Expand Up @@ -302,9 +302,6 @@ void SetupClock() // to be setted properly
rcc_dev_clk_speed_table[RCC_APB1] = (SystemCoreClock/4);
}

// alfran ----- end


void rcc_clk_init(rcc_sysclk_src sysclk_src,
rcc_pllsrc pll_src,
rcc_pll_multiplier pll_mul) {
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/usb_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern __IO uint32_t UserRxBufPtrIn;
extern __IO uint32_t UserRxBufPtrOut;
__IO uint32_t usbEnableBlockingTx;

USBSerial Serial;
//USBSerial Serial;
USBSerial SerialUSB;


Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/usb_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class USBSerial : public Stream {

};

extern USBSerial Serial;
//extern USBSerial Serial;
extern USBSerial SerialUSB;

#endif
18 changes: 9 additions & 9 deletions libraries/Audio/example/SimpleAudioPlayer/SimpleAudioPlayer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(115200);
delay(15000);
SerialUSB.begin(115200);
while(!SerialUSB);

/* Test begin() method */
while (SD.begin(SD_DETECT_PIN) != TRUE)
Expand All @@ -38,21 +38,21 @@ void loop() {
const int S = 1024; // Number of samples to read in block
uint32_t buffer[S];
int duration;
delay(5000); // delay for console
delay(1000); // delay for console

File myFile = SD.open("test.wav");
if (!myFile.available()) {
// if the file didn't open, print an error and stop
Serial.println("error opening test.wav");
SerialUSB.println("error opening test.wav");
while (true);
} else {
Serial.println("test.wav open OK");
SerialUSB.println("test.wav open OK");
}

myFile.read((void*) &WaveFormat, sizeof(WaveFormat));

delay(1000);
Serial.println("STARTUP AUDIO\r\n");
SerialUSB.println("STARTUP AUDIO\r\n");
delay(1000);
Audio.begin(WaveFormat.SampleRate, 100);

Expand All @@ -68,7 +68,7 @@ void loop() {
// Every 100 block print a '.'
count++;
if (count == 1000) {
Serial.print(".");
SerialUSB.print(".");
count = 0;
}
// read from the file into buffer
Expand All @@ -78,11 +78,11 @@ void loop() {
Audio.write(buffer, sizeof(buffer));
}
/* reaching end of file */
Serial.println("End of file. Thank you for listening!");
SerialUSB.println("End of file. Thank you for listening!");
Audio.end();
myFile.close();

delay(5000);
Serial.println("Restart Playing");
SerialUSB.println("Restart Playing");

}

This file was deleted.

Loading