summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9b05952)
this is finally clearer, especially because we will add modes in next
commit
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
-static void set_output(int16_t i)
-{
- int8_t detected = 0;
-
- if (cpt_filter > 250)
- detected = 1;
-
-#ifdef HOST_VERSION
- printf("%d fil_fond=%d fil_harm1=%d fil_other=%d\n",
- i, fil_fond, fil_harm1, fil_other);
- printf("%d pow_fond=%d pow_harm1=%d pow_other=%d cpt_filter=%d detected=%d\n",
- i, pow_fond, pow_harm1, pow_other, cpt_filter, detected);
-#else
- if (detected)
- LED_ON();
- else
- LED_OFF();
-
- /* when we receive, output a square signal at 625 hz */
- if ((detected == 1) && (i & 4))
- BUZZER_ON();
- else
- BUZZER_OFF();
-#endif
-}
-
/*
The CPU runs at 8Mhz.
Fe = 5Khz
/*
The CPU runs at 8Mhz.
Fe = 5Khz
int16_t i;
/* led and buzzer are outputs */
int16_t i;
/* led and buzzer are outputs */
else if (cpt_filter > 0)
cpt_filter--;
else if (cpt_filter > 0)
cpt_filter--;
+#ifdef HOST_VERSION
+ /* display values */
+ printf("%d fil_fond=%d fil_harm1=%d fil_other=%d\n",
+ i, fil_fond, fil_harm1, fil_other);
+ printf("%d pow_fond=%d pow_harm1=%d pow_other=%d "
+ "cpt_filter=%d detected=%d\n",
+ i, pow_fond, pow_harm1, pow_other, cpt_filter, detected);
+#else
+ if (detected)
+ LED_ON();
+ else
+ LED_OFF();
+
+ /* output a square signal at 625 hz if beacon is
+ * detected */
+ if ((detected == 1) && (i & 4))
+ BUZZER_ON();
+ else
+ BUZZER_OFF();
+
+#endif
#ifdef HOST_VERSION
if (i >= sizeof(x))
break;
#ifdef HOST_VERSION
if (i >= sizeof(x))
break;