|
|
@@ -8,7 +8,18 @@
|
|
|
/* Read directly from the G0 CC1101 pin, and draw a black or white
|
|
|
* dot depending on the level. */
|
|
|
void render_view_direct_sampling(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
- UNUSED(app);
|
|
|
+ if (!app->direct_sampling_enabled) {
|
|
|
+ canvas_set_font(canvas, FontSecondary);
|
|
|
+ canvas_draw_str(canvas,2,9,"Direct sampling is a special");
|
|
|
+ canvas_draw_str(canvas,2,18,"mode that displays the signal");
|
|
|
+ canvas_draw_str(canvas,2,27,"captured in real time. Like in");
|
|
|
+ canvas_draw_str(canvas,2,36,"a old CRT TV. It's very slow.");
|
|
|
+ canvas_draw_str(canvas,2,45,"Can crash your Flipper.");
|
|
|
+ canvas_set_font(canvas, FontPrimary);
|
|
|
+ canvas_draw_str(canvas,14,60,"To enable press OK");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
for (int y = 0; y < 64; y++) {
|
|
|
for (int x = 0; x < 128; x++) {
|
|
|
bool level = furi_hal_gpio_read(&gpio_cc1101_g0);
|
|
|
@@ -26,8 +37,9 @@ void render_view_direct_sampling(Canvas *const canvas, ProtoViewApp *app) {
|
|
|
|
|
|
/* Handle input */
|
|
|
void process_input_direct_sampling(ProtoViewApp *app, InputEvent input) {
|
|
|
- UNUSED(app);
|
|
|
- UNUSED(input);
|
|
|
+ if (input.type == InputTypePress && input.key == InputKeyOk) {
|
|
|
+ app->direct_sampling_enabled = !app->direct_sampling_enabled;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* Enter view. Stop the subghz thread to prevent access as we read
|
|
|
@@ -51,4 +63,5 @@ void view_exit_direct_sampling(ProtoViewApp *app) {
|
|
|
} else {
|
|
|
raw_sampling_worker_start(app);
|
|
|
}
|
|
|
+ app->direct_sampling_enabled = false;
|
|
|
}
|