Skip to content

Commit 436df21

Browse files
authored
Merge pull request #2 from andr0423/master
Updating for modern API (>=79.2)
2 parents cee4670 + 761d6e2 commit 436df21

File tree

7 files changed

+86
-81
lines changed

7 files changed

+86
-81
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "FAP: Build for multiple SDK sources"
2+
# This will build your app for dev and release channels on GitHub.
3+
# It will also build your app every day to make sure it's up to date with the latest SDK changes.
4+
# See https://github.com/marketplace/actions/build-flipper-application-package-fap for more information
5+
6+
on:
7+
push:
8+
## put your main branch name under "branches"
9+
#branches:
10+
# - master
11+
pull_request:
12+
schedule:
13+
# do a build every day
14+
- cron: "1 1 * * *"
15+
16+
jobs:
17+
ufbt-build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
include:
22+
- name: dev channel
23+
sdk-channel: dev
24+
- name: release channel
25+
sdk-channel: release
26+
# You can add unofficial channels here. See ufbt action docs for more info.
27+
name: 'ufbt: Build for ${{ matrix.name }}'
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Build with ufbt
32+
uses: flipperdevices/[email protected]
33+
id: build-app
34+
with:
35+
sdk-channel: ${{ matrix.sdk-channel }}
36+
- name: Upload app artifacts
37+
uses: actions/upload-artifact@v3
38+
with:
39+
# See ufbt action docs for other output variables
40+
name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
41+
path: ${{ steps.build-app.outputs.fap-artifacts }}

.gitignore

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,6 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Object files
5-
*.o
6-
*.ko
7-
*.obj
8-
*.elf
9-
10-
# Linker output
11-
*.ilk
12-
*.map
13-
*.exp
14-
15-
# Precompiled Headers
16-
*.gch
17-
*.pch
18-
19-
# Libraries
20-
*.lib
21-
*.a
22-
*.la
23-
*.lo
24-
25-
# Shared objects (inc. Windows DLLs)
26-
*.dll
27-
*.so
28-
*.so.*
29-
*.dylib
30-
31-
# Executables
32-
*.exe
33-
*.out
34-
*.app
35-
*.i*86
36-
*.x86_64
37-
*.hex
38-
39-
# Debug files
40-
*.dSYM/
41-
*.su
42-
*.idb
43-
*.pdb
44-
45-
# Kernel Module Compile Results
46-
*.mod*
47-
*.cmd
48-
.tmp_versions/
49-
modules.order
50-
Module.symvers
51-
Mkfile.old
52-
dkms.conf
1+
dist/*
2+
.vscode
3+
.clang-format
4+
.editorconfig
5+
.env
6+
.ufbt

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
# flipper-logic_analyzer
2-
I was missing a simple way of using Flipper as logic analyzer with e.g. PulseView, so I created a (prototype) plugin.
3-
4-
Just start the Flipper application and you will see smth like that for now:
5-
6-
[Video](http://cdn.discordapp.com/attachments/1074401633615749230/1074405882923864174/pulseview_2023-02-12_20-03-11.mp4 "Video")
7-
8-
Then start PulseView and add a new "Openbench Logic Sniffer (ols)"
9-
and select the second flipper serial port.
1+
# flipper-logic-analyzer
2+
Source: https://github.com/g3gg0/flipper-logic_analyzer
3+
I'm in the process of bringing this in line with the latest flipper firmwares. Right now it loads on my flipper, next I need to test its functionality for bugs. Here are the steps I used to upload:
4+
1. Install [ufbt](https://github.com/flipperdevices/flipperzero-ufbt) (`pip install --upgrade ufbt`)
5+
2. Install [PulseView](https://www.sigrok.org/wiki/Downloads)
6+
3. Clone this repo: `git clone https://github.com/ecopsychologer/flipper-logic-analyzer`
7+
4. Change directories into the repo: `cd flipper-logic-analyzer`
8+
5. Run the app `ufbt launch APPID=logic_analyzer`
9+
6. Launch PulseView and connect to channels C0, C1, C3, B2, B3, A4, A6, A7
10+
Try to start pulseview from the terminal
11+
if you encounter problems with the configuration pulseview via gui
12+
13+
pulseview -d ols:conn=/dev/ttyACM1
14+
15+
#### continued instructions from the original developer:
16+
Then start PulseView and add a new "Openbench Logic Sniffer (ols)" and select the second flipper serial port.
1017

1118
When arming, you can now look at the trace in PulseView.
1219

13-
Current state:
20+
Changes:
1421
- all 8 channels supported Channel 0 is C0, Channel 1 is C1, ... Channel 7 is A7
1522
- fixed sampling rate not supported (yet?)
1623
- if a trigger level is defined, no matter which one, the signals are captured as soon this signal changes

application.fam

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
# For details & more options, see documentation/AppManifests.md in firmware repo
2+
13
App(
2-
appid="logic_analyzer",
3-
name="Logic Analyzer",
4-
apptype=FlipperAppType.PLUGIN,
4+
appid="logic_analyzer", # Must be unique
5+
name="GPIO Logic Analyzer", # Displayed in menus
6+
apptype=FlipperAppType.EXTERNAL,
57
entry_point="logic_analyzer_app_main",
6-
cdefines=["APP_LOGIC_ANALYZER"],
7-
requires=["gui", "storage", "dialogs"],
88
stack_size=2 * 1024,
9-
order=10,
10-
fap_icon="icons/app.png",
11-
fap_category="Tools",
12-
fap_icon_assets="icons"
9+
fap_category="GPIO",
10+
# Optional values
11+
# fap_version="1.1",
12+
fap_icon="icons/app.png", # 10x10 1-bit PNG
13+
# fap_description="A simple app",
14+
# fap_author="g3gg0 (originally)",
15+
# fap_weburl="https://github.com/ecopsychologer/flipper-logic-analyzer",
16+
fap_icon_assets="icons", # Image assets to compile for this application
1317
)

icons/template.png

220 Bytes
Loading

logic_analyzer_app.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22

33
#include "logic_analyzer_app.h"
4-
#include "logic_analyzer_icons.h"
54

65
#define COUNT(x) ((size_t)(sizeof(x) / sizeof((x)[0])))
76

@@ -17,7 +16,7 @@ static const GpioPin* gpios[] = {
1716
&gpio_ext_pa6,
1817
&gpio_ext_pa7};
1918

20-
// static const char* gpio_names[] = {"PC0", "PC1", "PC3", "PB2", "PB3", "PA4", "PA6", "PA7"};
19+
//static const char* gpio_names[] = {"PC0", "PC1", "PC3", "PB2", "PB3", "PA4", "PA6", "PA7"};
2120

2221
static void render_callback(Canvas* const canvas, void* cb_ctx) {
2322
AppFSM* app = cb_ctx;
@@ -43,7 +42,7 @@ static void render_callback(Canvas* const canvas, void* cb_ctx) {
4342
UsbUartState st;
4443
usb_uart_get_state(app->uart, &st);
4544

46-
snprintf(buffer, sizeof(buffer), "Rx %ld / Tx %ld", st.rx_cnt, st.tx_cnt);
45+
snprintf(buffer, sizeof(buffer), "Rx %ld | Tx %ld", st.rx_cnt, st.tx_cnt);
4746
canvas_draw_str_aligned(canvas, 5, y, AlignLeft, AlignBottom, buffer);
4847
y += 20;
4948
}
@@ -83,13 +82,13 @@ static void render_callback(Canvas* const canvas, void* cb_ctx) {
8382
furi_mutex_release(app->mutex);
8483
}
8584

86-
static void input_callback(InputEvent* input_event, FuriMessageQueue* event_queue) {
87-
furi_assert(event_queue);
85+
static void input_callback(InputEvent* input_event, void* event_queue) {
86+
furi_assert((FuriMessageQueue*)event_queue);
8887

8988
/* better skip than sorry */
90-
if(furi_message_queue_get_count(event_queue) < QUEUE_SIZE) {
89+
if(furi_message_queue_get_count((FuriMessageQueue*)event_queue) < QUEUE_SIZE) {
9190
AppEvent event = {.type = EventKeyPress, .input = *input_event};
92-
furi_message_queue_put(event_queue, &event, 100);
91+
furi_message_queue_put((FuriMessageQueue*)event_queue, &event, 100);
9392
}
9493
}
9594

@@ -301,7 +300,7 @@ int32_t logic_analyzer_app_main(void* p) {
301300
AppFSM* app = malloc(sizeof(AppFSM));
302301
app_init(app);
303302

304-
DOLPHIN_DEED(DolphinDeedPluginGameStart);
303+
dolphin_deed(DolphinDeedPluginGameStart);
305304
notification_message_block(app->notification, &sequence_display_backlight_enforce_on);
306305

307306
while(app->processing) {

sump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ void sump_handle_get_metadata(Sump* sump) {
1111
uint8_t buf[128];
1212
size_t pos = 0;
1313

14-
const char* name = "Flipper LogicAnalyzer v1.0 (g3gg0.de)";
14+
const char* name = "Flipper LogicAnalyzer v1.0 (originally by g3gg0.de)";
1515
const char* fpga = "(none)";
16-
const char* firmware = "v1.0";
16+
const char* firmware = "v0.99.1";
1717
const uint8_t probes = 8;
1818
uint32_t max_sample_rate = 10000000;
1919
uint32_t max_sample_mem = MAX_SAMPLE_MEM;

0 commit comments

Comments
 (0)