This commit is contained in:
flo 2017-02-26 14:16:21 +01:00
parent df07aa65b0
commit 25eb828a72
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
#ifndef _MAIN
#define _MAIN
#ifndef _MAIN_H
#define _MAIN_H
#endif

View File

@ -1,10 +1,6 @@
#ifndef _SOUND4CALC_H
#define _SOUND4CALC_H
extern char* wave_signal = "-_"; // simple waveform*
extern unsigned short freq = 440; // frequency by default : to get La3
extern unsigned short duration = 2000; // equivalent as 2000 ms duration sound
void CallSequence();
void PutPinState(char level);
void PlayNote();

View File

@ -1,5 +1,5 @@
#include "main.h"
#include <sound4calc.h>
#include "sound4calc.h"
//#include <timer.h> // add timer fonction
#include <display.h> // add display fonction
#include <keyboard.h>
@ -9,6 +9,7 @@
int main(void)
{
unsigned int key = 0;
unsigned short place = 2;
//unsigned int i=0;
InitPorts();
@ -20,7 +21,7 @@ int main(void)
dprint(1, 1, "%d", freq);
dprint(1, 10, "%s", wave_signal);
//dprint(1, 20, "%d", place);
dtext(1, 50, "F1 _ F2 -");
dtext(1, 50, "F5 _ F6 -");
dupdate();
@ -33,9 +34,9 @@ int main(void)
case KEY_UP : freq+=10; break;
case KEY_DOWN : freq-=10; break;
//case KEY_F1 : *(bincod+place++) = '_'; break;
//case KEY_F2 : *(bincod+place++) = '-'; break;
//case KEY_DEL : place=(place>0 ? place - 1 : 0); *(bincod+place) = 0; break;
case KEY_F5 : *(wave_signal+place++) = '_'; break;
case KEY_F6 : *(wave_signal+place++) = '-'; break;
case KEY_DEL : place=(place>0 ? place - 1 : 0); *(wave_signal+place) = 0; break;
case KEY_EXE :
CallNote();

View File

@ -2,7 +2,6 @@
#include <mpu.h> // from Gint
#include <timer.h> //from Gint
static struct {
int freq;
int length_ms;
@ -13,6 +12,10 @@ static struct {
{ -1, -1 }
};
extern char* wave_signal = "-_"; // simple waveform*
extern unsigned short duration = 2000; // equivalent as 2000 ms duration sound
extern unsigned int freq = 440;
void CallSequence()
{
static int length_end = 0;