Skip to content

Commit 58f9524

Browse files
committed
update LUTFreq and ???
1 parent 471b84e commit 58f9524

File tree

3 files changed

+106
-104
lines changed

3 files changed

+106
-104
lines changed

Blinky.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,14 +715,14 @@ void timers_isr1 (void) interrupt 3 using 2
715715
TH1 = periodH1; //remember this only counts up!!!!
716716
TL1 = periodL1;
717717
//generate square waves
718-
_nop_(); //matching cycles to t0 rupt TODO retune
719-
_nop_();
720-
_nop_();
721718
if(AUDIO_L_ON) { //could play with nops here
722719
audioL ^= 1;
723720
}
724721
#ifdef DAC1_OUT_AUDIO
725722
AD1DAT3 = LUTSIN128[dac1LUTdex++ & 0x7F];
723+
#else
724+
//just for the delay... hopefully it doesnt mess up ADC0
725+
AD1DAT0 = LUTSIN128[dac1LUTdex & 0x7F];
726726
#endif
727727
#endif
728728
}
@@ -767,6 +767,8 @@ void timers_isr0 (void) interrupt 1 using 3
767767
}
768768
#ifdef DAC1_OUT_VCC
769769
AD1DAT3 = LUTSIN128[dac1LUTdex++ & 0x7F];
770+
#else
771+
AD1DAT0 = LUTSIN128[dac1LUTdex & 0x7F];
770772
#endif
771773
#endif
772774
}

LUTFreq.c

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "LUTFreq.h"
1+
#include "LUTFreq.h"
22

3-
unsigned int code LUTFreq[LUT_LEN] = {
3+
const unsigned int code LUTFreq[LUT_LEN] = {
44
// 0,
55
// 0,
66
// 0,
@@ -12,102 +12,102 @@ unsigned int code LUTFreq[LUT_LEN] = {
1212
// 0,
1313
// 0,
1414
0,
15-
2376,
16-
5918,
17-
9256,
18-
12425,
19-
15407,
20-
18219,
21-
20874,
22-
23382,
23-
25754,
24-
27988,
25-
30095,
26-
32088,
27-
33967,
28-
35743,
29-
37416,
30-
38996,
31-
40488,
32-
41893,
33-
43224,
34-
44478,
35-
45661,
36-
46778,
37-
47833,
38-
48828,
39-
49767,
40-
50654,
41-
51491,
42-
52281,
43-
53027,
44-
53731,
45-
54395,
46-
55022,
47-
55614,
48-
56173,
49-
56700,
50-
57198,
51-
57668,
52-
58111,
53-
58530,
54-
58925,
55-
59297,
56-
59650,
57-
59982,
58-
60295,
59-
60591,
60-
60871,
61-
61134,
62-
61383,
63-
61618,
64-
61840,
65-
62049,
66-
62246,
67-
62433,
68-
62609,
69-
62775,
70-
62932,
71-
63080,
72-
63219,
73-
63351,
74-
63475,
75-
63593,
76-
63704,
77-
63808,
78-
63907,
79-
64000,
80-
64088,
81-
64171,
82-
64250,
83-
64324,
84-
64394,
85-
64460,
86-
64522,
87-
64580,
88-
64636,
89-
64688,
90-
64738,
91-
64784,
92-
64828,
93-
64870,
94-
64909,
95-
64946,
96-
64981,
97-
65014,
98-
65045,
99-
65074,
100-
65102,
15+
2465,
16+
6003,
17+
9338,
18+
12503,
19+
15483,
20+
18292,
21+
20944,
22+
23450,
23+
25819,
24+
28051,
25+
30156,
26+
32147,
27+
34024,
28+
35798,
29+
37470,
30+
39048,
31+
40538,
32+
41943,
33+
43271,
34+
44524,
35+
45706,
36+
46822,
37+
47876,
38+
48870,
39+
49809,
40+
50695,
41+
51531,
42+
52320,
43+
53065,
44+
53768,
45+
54432,
46+
55058,
47+
55650,
48+
56208,
49+
56735,
50+
57232,
51+
57701,
52+
58144,
53+
58562,
54+
58957,
55+
59329,
56+
59681,
57+
60013,
58+
60326,
59+
60622,
60+
60901,
61+
61164,
62+
61413,
63+
61647,
64+
61869,
65+
62078,
66+
62275,
67+
62461,
68+
62637,
69+
62803,
70+
62960,
71+
63108,
72+
63247,
73+
63379,
74+
63503,
75+
63620,
76+
63731,
77+
63836,
78+
63934,
79+
64027,
80+
64115,
81+
64198,
82+
64277,
83+
64351,
84+
64420,
85+
64486,
86+
64548,
87+
64607,
88+
64662,
89+
64715,
90+
64764,
91+
64810,
92+
64854,
93+
64896,
94+
64935,
95+
64972,
96+
65007,
97+
65040,
98+
65071,
99+
65100,
101100
65128,
102-
65153,
103-
65176,
104-
65198,
105-
65219,
106-
65239,
107-
65257,
108-
65275,
109-
65291,
110-
65307,
111-
65321,
112-
65335 //note 109
113-
};
101+
65154,
102+
65179,
103+
65202,
104+
65224,
105+
65245,
106+
65264,
107+
65283,
108+
65300,
109+
65317,
110+
65332,
111+
65347,
112+
65361
113+
};

LUTFreq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
#define LUT_LEN (LUT_NUM_NOTES)
77
#define LUT_NOTE_LIMIT (LUT_LEN + LUT_MIDI_NOTE_SHIFT)
88

9-
extern unsigned int code LUTFreq[LUT_LEN];
9+
extern const unsigned int code LUTFreq[LUT_LEN];
1010

1111
#endif

0 commit comments

Comments
 (0)