Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
OneBitSound/SoundBlock.cpp
- Committer:
- taylorza
- Date:
- 2015-01-28
- Revision:
- 0:d85c449aca6d
File content as of revision 0:d85c449aca6d:
#include "mbed.h" #include "Fix16.h" #include "SoundBlock.h" SoundBlock::SoundBlock(ToneType toneType, uint16_t stepCount, uint16_t stepDuration, uint16_t pitch, int16_t pitchSlide, uint8_t duty, int8_t dutySlide) { initialize(toneType, stepCount, stepDuration, pitch, pitchSlide, duty, dutySlide); } SoundBlock::SoundBlock(ToneType toneType, uint16_t stepCount, uint16_t stepDuration) { initialize(toneType, stepCount, stepDuration, 0, 0, 128, 0); } SoundBlock::SoundBlock() {} void SoundBlock::initialize(ToneType toneType, uint16_t stepCount, uint16_t stepDuration, uint16_t pitch, int16_t pitchSlide, uint8_t duty, int8_t dutySlide) { _toneType = toneType; _stepCount = stepCount; _stepDuration = stepDuration; _pitch = fix16_from(pitch); _pitchSlide = fix16_from(pitchSlide); _duty = duty; _dutySlide = dutySlide; }