Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 52 → Rev 53

/IR-TX-BL/branches/LED-CTRL_V0.01/main.c
205,6 → 205,7
int main (void)
{
unsigned int i;
unsigned int ppm;
unsigned char colorState;
unsigned char nextcolorState=0;
 
239,8 → 240,21
while (1)
{
 
//printf("%d ",ppm_signal);
/*
#define step 128
#define mul 2
 
if ((ppm >= (step * 0) && (ppm < (step * 1))) ch0 = mul * ((ppm - (step * 0)));
if ((ppm >= (step * 1)) && (ppm < (step * 2))) ch1 = mul * ((ppm - (step * 1)));
if ((ppm >= (step * 2)) && (ppm < (step * 3))) ch0 = mul * ((step - 1) - (ppm - (step * 2)));
if ((ppm >= (step * 3)) && (ppm < (step * 4))) ch2 = mul * ((ppm - (step * 3)));
if ((ppm >= (step * 4)) && (ppm < (step * 5))) ch1 = mul * ((step - 1) - (ppm - (step * 4)));
if ((ppm >= (step * 5)) && (ppm < (step * 6))) ch0 = mul * ((ppm - (step * 5)));
if ((ppm >= (step * 6)) && (ppm < (step * 7))) ch2 = mul * ((step - 1) - (ppm - (step * 6)));
 
//printf("%d ",ppm);
*/
 
for (i=0; i<=255; i++)
{
switch(colorState)
297,85 → 311,3
 
}
 
 
 
/*
170 00fa 1F92 push __zero_reg__
171 00fc 0F92 push __tmp_reg__
172 00fe 0FB6 in __tmp_reg__,__SREG__
173 0100 0F92 push __tmp_reg__
174 0102 1124 clr __zero_reg__
175 0104 2F93 push r18
176 0106 3F93 push r19
177 0108 8F93 push r24
178 010a 9F93 push r25
181 010c 38B3 in r19,56-0x20
184 010e 22B3 in r18,50-0x20
187 0110 8091 0000 lds r24,counter.1797
188 0114 8F5F subi r24,lo8(-(1))
189 0116 8093 0000 sts counter.1797,r24
190 011a 8F3F cpi r24,lo8(-1)
191 011c 01F4 brne .L15
193 011e 3E60 ori r19,lo8(14)
195 0120 2863 ori r18,lo8(56)
197 0122 8091 0000 lds r24,ch0
198 0126 8093 0000 sts ch0_tmp,r24
200 012a 8091 0000 lds r24,ch1
201 012e 8093 0000 sts ch1_tmp,r24
203 0132 8091 0000 lds r24,ch2
204 0136 8093 0000 sts ch2_tmp,r24
206 013a 8091 0000 lds r24,ch3
207 013e 8093 0000 sts ch3_tmp,r24
209 0142 8091 0000 lds r24,ch4
210 0146 8093 0000 sts ch4_tmp,r24
212 014a 8091 0000 lds r24,ch5
213 014e 8093 0000 sts ch5_tmp,r24
215 0152 1092 0000 sts counter.1797,__zero_reg__
218 0156 8091 0000 lds r24,ch0_tmp
219 015a 9091 0000 lds r25,counter.1797
220 015e 8917 cp r24,r25
221 0160 01F4 brne .L17
222 0162 377F andi r19,lo8(-9)
225 0164 8091 0000 lds r24,ch1_tmp
226 0168 8917 cp r24,r25
227 016a 01F4 brne .L19
228 016c 3B7F andi r19,lo8(-5)
231 016e 8091 0000 lds r24,ch2_tmp
232 0172 8917 cp r24,r25
233 0174 01F4 brne .L21
234 0176 3D7F andi r19,lo8(-3)
237 0178 8091 0000 lds r24,ch3_tmp
238 017c 8917 cp r24,r25
239 017e 01F4 brne .L23
240 0180 277F andi r18,lo8(-9)
243 0182 8091 0000 lds r24,ch4_tmp
244 0186 8917 cp r24,r25
245 0188 01F4 brne .L25
246 018a 2F7E andi r18,lo8(-17)
249 018c 8091 0000 lds r24,ch5_tmp
250 0190 8917 cp r24,r25
251 0192 01F4 brne .L27
252 0194 2F7D andi r18,lo8(-33)
255 0196 38BB out 56-0x20,r19
257 0198 22BB out 50-0x20,r18
259 019a 8091 0000 lds r24,ms1.1798
260 019e 8F5F subi r24,lo8(-(1))
261 01a0 8093 0000 sts ms1.1798,r24
262 01a4 8132 cpi r24,lo8(33)
263 01a6 01F4 brne .L31
265 01a8 1092 0000 sts ms1.1798,__zero_reg__
267 01ac 8091 0000 lds r24,TMR1MS
268 01b0 9091 0000 lds r25,(TMR1MS)+1
269 01b4 0196 adiw r24,1
270 01b6 9093 0000 sts (TMR1MS)+1,r25
271 01ba 8093 0000 sts TMR1MS,r24
274 01be 9F91 pop r25
275 01c0 8F91 pop r24
276 01c2 3F91 pop r19
277 01c4 2F91 pop r18
278 01c6 0F90 pop __tmp_reg__
279 01c8 0FBE out __SREG__,__tmp_reg__
280 01ca 0F90 pop __tmp_reg__
281 01cc 1F90 pop __zero_reg__
282 01ce 1895 reti
*/