summaryrefslogtreecommitdiff
path: root/apps/plugins/pitch_detector.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pitch_detector.c')
-rw-r--r--apps/plugins/pitch_detector.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c
index 5f375d1007..10125c1302 100644
--- a/apps/plugins/pitch_detector.c
+++ b/apps/plugins/pitch_detector.c
@@ -289,7 +289,9 @@ static const struct note_entry notes[] =
289}; 289};
290 290
291/* GUI */ 291/* GUI */
292static unsigned back_color, front_color; 292#if LCD_DEPTH > 1
293static unsigned front_color;
294#endif
293static int font_w,font_h; 295static int font_w,font_h;
294static int bar_x_0; 296static int bar_x_0;
295static int lbl_x_minus_50, lbl_x_minus_20, lbl_x_0, lbl_x_20, lbl_x_50; 297static int lbl_x_minus_50, lbl_x_minus_20, lbl_x_0, lbl_x_20, lbl_x_50;
@@ -610,8 +612,9 @@ fixed log(fixed inp)
610void print_int_xy(int x, int y, int v) 612void print_int_xy(int x, int y, int v)
611{ 613{
612 char temp[20]; 614 char temp[20];
613 615#if LCD_DEPTH > 1
614 rb->lcd_set_foreground(front_color); 616 rb->lcd_set_foreground(front_color);
617#endif
615 rb->snprintf(temp,20,"%d",v); 618 rb->snprintf(temp,20,"%d",v);
616 rb->lcd_putsxy(x,y,temp); 619 rb->lcd_putsxy(x,y,temp);
617} 620}
@@ -619,7 +622,9 @@ void print_int_xy(int x, int y, int v)
619/* Print out the frequency etc */ 622/* Print out the frequency etc */
620void print_str(char* s) 623void print_str(char* s)
621{ 624{
625#if LCD_DEPTH > 1
622 rb->lcd_set_foreground(front_color); 626 rb->lcd_set_foreground(front_color);
627#endif
623 rb->lcd_putsxy(0, HZ_Y, s); 628 rb->lcd_putsxy(0, HZ_Y, s);
624} 629}
625 630
@@ -630,7 +635,9 @@ void print_char_xy(int x, int y, char c)
630 635
631 temp[0]=c; 636 temp[0]=c;
632 temp[1]=0; 637 temp[1]=0;
638#if LCD_DEPTH > 1
633 rb->lcd_set_foreground(front_color); 639 rb->lcd_set_foreground(front_color);
640#endif
634 641
635 rb->lcd_putsxy(x, y, temp); 642 rb->lcd_putsxy(x, y, temp);
636} 643}
@@ -674,8 +681,6 @@ void draw_bar(fixed wrong_by_cents)
674 rb->lcd_set_foreground(LCD_RGBPACK(255,255,255)); /* Color screens */ 681 rb->lcd_set_foreground(LCD_RGBPACK(255,255,255)); /* Color screens */
675#elif LCD_DEPTH > 1 682#elif LCD_DEPTH > 1
676 rb->lcd_set_foreground(LCD_BLACK); /* Greyscale screens */ 683 rb->lcd_set_foreground(LCD_BLACK); /* Greyscale screens */
677#else
678 rb->lcd_set_foreground(LCD_BLACK); /* Black and white screens */
679#endif 684#endif
680 685
681 rb->lcd_hline(0,LCD_WIDTH-1, BAR_HLINE_Y); 686 rb->lcd_hline(0,LCD_WIDTH-1, BAR_HLINE_Y);
@@ -700,8 +705,6 @@ void draw_bar(fixed wrong_by_cents)
700 rb->lcd_set_foreground(LCD_RGBPACK(255,0,0)); /* Color screens */ 705 rb->lcd_set_foreground(LCD_RGBPACK(255,0,0)); /* Color screens */
701#elif LCD_DEPTH > 1 706#elif LCD_DEPTH > 1
702 rb->lcd_set_foreground(LCD_DARKGRAY); /* Greyscale screens */ 707 rb->lcd_set_foreground(LCD_DARKGRAY); /* Greyscale screens */
703#else
704 rb->lcd_set_foreground(LCD_BLACK); /* Black and white screens */
705#endif 708#endif
706 709
707 if (fp_gt(wrong_by_cents, FP_ZERO)) 710 if (fp_gt(wrong_by_cents, FP_ZERO))
@@ -1109,8 +1112,9 @@ void init_everything(void)
1109 rb->pcm_init_recording(); 1112 rb->pcm_init_recording();
1110 1113
1111 /* GUI */ 1114 /* GUI */
1112 back_color = rb->lcd_get_background(); 1115#if LCD_DEPTH > 1
1113 front_color = rb->lcd_get_foreground(); 1116 front_color = rb->lcd_get_foreground();
1117#endif
1114 rb->lcd_getstringsize("X", &font_w, &font_h); 1118 rb->lcd_getstringsize("X", &font_w, &font_h);
1115 1119
1116 bar_x_0 = LCD_WIDTH / 2; 1120 bar_x_0 = LCD_WIDTH / 2;