Skip to content

Commit 0ce6f01

Browse files
authored
Merge pull request #42 from CodyTolene/ct/wifi-rev2
[#35] Wi-Fi Features (for Flipper Firmware v0.98-rc+) - Updates
2 parents b348254 + b5f342b commit 0ce6f01

16 files changed

+181
-191
lines changed

.github/workflows/build-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
app-dir: ./fap
2323
sdk-channel: dev
2424

25-
- name: "Create Zip Archive (dev)"
25+
- name: "Create FAP Download (dev)"
2626
uses: actions/upload-artifact@v3
2727
with:
2828
name: ${{ github.event.repository.name }}-dev-${{ steps.build-app.outputs.suffix }}.zip

.github/workflows/build-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
app-dir: ./fap
3939
sdk-channel: ${{ matrix.sdk-channel }}
4040

41-
- name: "Create Zip Archives (dev/release/rc)"
41+
- name: "Create FAP Downloads (dev/release/rc)"
4242
uses: actions/upload-artifact@v3
4343
with:
4444
name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ steps.build-app.outputs.suffix }}.zip

fap/camera_suite.h

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#pragma once
22

33
#include <furi.h>
4+
#include <furi_hal.h>
5+
#include <furi_hal_serial.h>
6+
#include <furi_hal_serial_control.h>
47
#include <gui/gui.h>
58
#include <gui/modules/button_menu.h>
69
#include <gui/modules/submenu.h>
@@ -11,16 +14,31 @@
1114
#include <notification/notification_messages.h>
1215
#include <stdlib.h>
1316

17+
#include "helpers/camera_suite_storage.h"
1418
#include "scenes/camera_suite_scene.h"
19+
#include "views/camera_suite_view_camera.h"
1520
#include "views/camera_suite_view_guide.h"
1621
#include "views/camera_suite_view_start.h"
17-
#include "views/camera_suite_view_camera.h"
1822
#include "views/camera_suite_view_wifi_camera.h"
19-
#include "helpers/camera_suite_storage.h"
23+
24+
#define TAG "Camera Suite"
25+
#include <furi.h>
26+
#define FLIPPER_SCREEN_HEIGHT 64
27+
#define FLIPPER_SCREEN_WIDTH 128
2028

2129
#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
2230

23-
#define TAG "Camera Suite"
31+
#ifdef xtreme_settings
32+
/**
33+
* Enable the following line for "Xtreme Firmware" & "Xtreme Apps" (Flipper-XFW).
34+
*
35+
* @see https://github.com/Flipper-XFW/Xtreme-Firmware
36+
* @see https://github.com/Flipper-XFW/Xtreme-Apps
37+
*/
38+
#define UART_CH (xtreme_settings.uart_esp_channel)
39+
#else
40+
#define UART_CH (FuriHalSerialIdUsart)
41+
#endif
2442

2543
typedef struct {
2644
Gui* gui;
@@ -41,6 +59,9 @@ typedef struct {
4159
uint32_t speaker;
4260
uint32_t led;
4361
ButtonMenu* button_menu;
62+
FuriHalSerialHandle* serial_handle;
63+
FuriStreamBuffer* rx_stream;
64+
FuriThread* worker_thread;
4465
} CameraSuite;
4566

4667
typedef enum {

fap/helpers/camera_suite_haptic.h

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
#include <notification/notification_messages.h>
44

55
void camera_suite_play_happy_bump(void* context);
6-
76
void camera_suite_play_bad_bump(void* context);
8-
97
void camera_suite_play_long_bump(void* context);

fap/helpers/camera_suite_led.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma once
2-
31
void camera_suite_led_set_rgb(void* context, int red, int green, int blue);
42

53
void camera_suite_led_reset(void* context);

fap/helpers/camera_suite_speaker.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#define NOTE_INPUT 587.33f
4-
53
void camera_suite_play_input_sound(void* context);
64

75
void camera_suite_stop_all_sound(void* context);

fap/helpers/camera_suite_uart.c

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include "camera_suite_uart.h"
2+
#include "../camera_suite.h"
3+
4+
// void camera_suite_uart_alloc(CameraSuite* instance, FuriThreadCallback* callback) {
5+
// // Allocate a stream buffer
6+
// instance->rx_stream = furi_stream_buffer_alloc(2048, 1);
7+
8+
// // Allocate a thread for this camera to run on.
9+
// FuriThread* thread = furi_thread_alloc_ex("UsbUartWorker", 2048, callback, instance);
10+
// instance->worker_thread = thread;
11+
// furi_thread_start(instance->worker_thread);
12+
13+
// // Set up UART thread.
14+
// instance->serial_handle = furi_hal_serial_control_acquire(UART_CH);
15+
// furi_check(instance->serial_handle);
16+
// furi_hal_serial_init(instance->serial_handle, 230400);
17+
18+
// // Enable UART1 and set the IRQ callback.
19+
// furi_hal_serial_async_rx_start(instance->serial_handle, callback, instance, false);
20+
// }
21+
22+
// void camera_suite_uart_free(CameraSuite* app_instance) {
23+
// furi_assert(app_instance);
24+
25+
// // Free the worker thread.
26+
// furi_thread_flags_set(furi_thread_get_id(app_instance->worker_thread), WorkerEventStop);
27+
// furi_thread_join(app_instance->worker_thread);
28+
// furi_thread_free(app_instance->worker_thread);
29+
30+
// // Free the stream buffer.
31+
// furi_stream_buffer_free(app_instance->rx_stream);
32+
33+
// // Free the serial handle.
34+
// furi_hal_serial_deinit(app_instance->serial_handle);
35+
// furi_hal_serial_control_release(app_instance->serial_handle);
36+
// }

fap/helpers/camera_suite_uart.h

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#pragma once
2+
3+
// void camera_suite_uart_alloc(CameraSuite* instance, FuriThreadCallback* callback);
4+
// void camera_suite_uart_free(CameraSuite* app_instance);

0 commit comments

Comments
 (0)