mirror of https://github.com/MLXXXp/Arduboy2.git
we already have a minimal begin, it's boot()
This commit is contained in:
parent
c25668de0e
commit
6ff1c13b22
|
@ -26,27 +26,21 @@ void Arduboy::start() // deprecated
|
||||||
|
|
||||||
void Arduboy::begin()
|
void Arduboy::begin()
|
||||||
{
|
{
|
||||||
boot();
|
boot(); // raw hardware
|
||||||
|
|
||||||
|
// utils
|
||||||
if(pressed(UP_BUTTON)) {
|
if(pressed(UP_BUTTON)) {
|
||||||
flashlight();
|
flashlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
bootLogo();
|
bootLogo();
|
||||||
|
|
||||||
// Audio
|
|
||||||
tunes.initChannel(PIN_SPEAKER_1);
|
|
||||||
tunes.initChannel(PIN_SPEAKER_2);
|
|
||||||
audio.begin();
|
audio.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arduboy::beginMinimal()
|
void Arduboy::beginNoLogo() // deprecated
|
||||||
{
|
{
|
||||||
boot();
|
boot();
|
||||||
|
|
||||||
// Audio
|
|
||||||
tunes.initChannel(PIN_SPEAKER_1);
|
|
||||||
tunes.initChannel(PIN_SPEAKER_2);
|
|
||||||
audio.begin();
|
audio.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,16 +41,25 @@ public:
|
||||||
*/
|
*/
|
||||||
boolean notPressed(uint8_t buttons);
|
boolean notPressed(uint8_t buttons);
|
||||||
|
|
||||||
/// Initializes the hardware
|
/// Initialize hardware, boot logo, boot utilities, etc.
|
||||||
void begin();
|
void begin();
|
||||||
/// Initializes the hardware (no logo, no other bootime niceities)
|
|
||||||
|
/// Init hardware, no logo, no boot utilities.
|
||||||
/**
|
/**
|
||||||
* If you want to build your own customized boot sequence compare
|
* If you really want this functionality going foward we recommend
|
||||||
* begin() with beginMinimal() and just add back the things you wish
|
* just call `boot()` directly, then do any other custom init you
|
||||||
* to have in your own sequence, leaving out the things you do not
|
* desire before passing control into your main sketch.
|
||||||
* desire.
|
*
|
||||||
**/
|
* Look at the source for `begin()` and just rip out what you do not
|
||||||
void beginMinimal();
|
* need and start there.
|
||||||
|
*
|
||||||
|
* The minimum functionality required is currently:
|
||||||
|
*
|
||||||
|
* boot() // raw hardware init (from core)
|
||||||
|
* audio.begin() // if you need audio
|
||||||
|
*/
|
||||||
|
void beginNoLogo() __attribute__ ((deprecated("use boot() + custom code instead")));
|
||||||
|
|
||||||
void start() __attribute__ ((deprecated("use begin() instead")));
|
void start() __attribute__ ((deprecated("use begin() instead")));
|
||||||
|
|
||||||
/// Scrolls in the Arduboy logo
|
/// Scrolls in the Arduboy logo
|
||||||
|
|
|
@ -43,6 +43,11 @@ bool ArduboyAudio::audio_enabled = false;
|
||||||
|
|
||||||
void ArduboyAudio::on()
|
void ArduboyAudio::on()
|
||||||
{
|
{
|
||||||
|
// JIT audio init
|
||||||
|
if (_tune_num_chans == 0) {
|
||||||
|
ArduboyTunes::initChannel(PIN_SPEAKER_1);
|
||||||
|
ArduboyTunes::initChannel(PIN_SPEAKER_2);
|
||||||
|
}
|
||||||
power_timer1_enable();
|
power_timer1_enable();
|
||||||
power_timer3_enable();
|
power_timer3_enable();
|
||||||
audio_enabled = true;
|
audio_enabled = true;
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
// Playtune Functions
|
// Playtune Functions
|
||||||
|
|
||||||
/// Assign a timer to an output pin.
|
/// Assign a timer to an output pin.
|
||||||
void initChannel(byte pin);
|
void static initChannel(byte pin);
|
||||||
|
|
||||||
/// Start playing a polyphonic score.
|
/// Start playing a polyphonic score.
|
||||||
void playScore(const byte *score);
|
void playScore(const byte *score);
|
||||||
|
|
Loading…
Reference in New Issue