Skip to content

Commit

Permalink
update audio asset, fix some things
Browse files Browse the repository at this point in the history
audio asset by @amec0e
  • Loading branch information
xMasterX committed Aug 30, 2022
1 parent f14874b commit 9ff35c9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 11 deletions.
19 changes: 10 additions & 9 deletions applications/nrfsniff/nrfsniff.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ static int get_highest_idx() {

// if array is full, start over from beginning
static void insert_addr(uint8_t* addr, uint8_t addr_size) {
if(candidate_idx >= MAX_ADDRS)
candidate_idx = 0;
if(candidate_idx >= MAX_ADDRS) candidate_idx = 0;

memcpy(candidates[candidate_idx], addr, addr_size);
counts[candidate_idx] = 1;
Expand Down Expand Up @@ -243,10 +242,10 @@ void alt_address(uint8_t* addr, uint8_t* altaddr) {
for(int i = 0; i < 5; i++) altaddr[i] = tmpaddr[4 - i];
}

static bool previously_confirmed(uint8_t *addr){
static bool previously_confirmed(uint8_t* addr) {
bool found = false;
for(int i = 0; i < MAX_CONFIRMED; i++){
if(!memcmp(confirmed[i], addr, 5)){
for(int i = 0; i < MAX_CONFIRMED; i++) {
if(!memcmp(confirmed[i], addr, 5)) {
found = true;
break;
}
Expand Down Expand Up @@ -290,14 +289,13 @@ static void wrap_up(Storage* storage, NotificationApp* notification) {
hexlify(addr, 5, top_address);
save_addr_to_file(storage, addr, 5, notification);
found_count++;
if(confirmed_idx < MAX_CONFIRMED)
memcpy(confirmed[confirmed_idx++], addr, 5);
if(confirmed_idx < MAX_CONFIRMED) memcpy(confirmed[confirmed_idx++], addr, 5);
break;
}
}
}

static void clear_cache(){
static void clear_cache() {
found_count = 0;
confirmed_idx = 0;
candidate_idx = 0;
Expand Down Expand Up @@ -410,7 +408,7 @@ int32_t nrfsniff_app(void* p) {
if(nrf24_sniff_address(nrf24_HANDLE, 5, address)) {
int idx;
uint8_t* top_addr;
if(!previously_confirmed(address)){
if(!previously_confirmed(address)) {
idx = get_addr_index(address, 5);
if(idx == -1)
insert_addr(address, 5);
Expand Down Expand Up @@ -439,6 +437,9 @@ int32_t nrfsniff_app(void* p) {
}

clear_cache();
sample_time = DEFAULT_SAMPLE_TIME;
target_rate = 8; // rate can be either 8 (2Mbps) or 0 (1Mbps)
sniffing_state = false;
furi_hal_spi_release(nrf24_HANDLE);
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
Expand Down
4 changes: 4 additions & 0 deletions applications/spectrum_analyzer/spectrum_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ int32_t spectrum_analyzer_app(void* p) {
SpectrumAnalyzer* spectrum_analyzer = spectrum_analyzer_alloc();
InputEvent input;

furi_hal_power_suppress_charge_enter();

FURI_LOG_D("Spectrum", "Main Loop - Starting worker");
furi_delay_ms(50);

Expand Down Expand Up @@ -503,6 +505,8 @@ int32_t spectrum_analyzer_app(void* p) {

spectrum_analyzer_worker_stop(spectrum_analyzer->worker);

furi_hal_power_suppress_charge_exit();

spectrum_analyzer_free(spectrum_analyzer);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions assets/resources/Manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
V:0
T:1661859394
T:1661895856
D:badusb
D:dolphin
D:infrared
Expand Down Expand Up @@ -242,7 +242,7 @@ F:f267f0654781049ca323b11bb4375519:581:dolphin/L3_Lab_research_128x54/frame_9.bm
F:41106c0cbc5144f151b2b2d3daaa0527:727:dolphin/L3_Lab_research_128x54/meta.txt
D:infrared/assets
F:13fe3def425723bccd05fe09c745a335:122232:infrared/assets/ac.ir
F:bbf2da1adc15aca3a2bb7f8a8800b81a:47577:infrared/assets/audio.ir
F:a3dad0916846fef907c93a65dd8e331d:52540:infrared/assets/audio.ir
F:1703fea41cb6ef71553b91a1004dc936:82397:infrared/assets/fans.ir
F:08d864cf44e2557fb25aec8837740de5:6567:infrared/assets/projectors.ir
F:77bc8314d113b8618942589f21a491fc:127350:infrared/assets/tv.ir
Expand Down
24 changes: 24 additions & 0 deletions assets/resources/infrared/assets/audio.ir
Original file line number Diff line number Diff line change
Expand Up @@ -1232,3 +1232,27 @@ protocol: NEC
address: 00 00 00 00
command: 15 00 00 00
#
name: POWER
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 8437 4188 538 1565 539 1565 539 513 544 508 538 513 544 1559 545 507 539 1564 540 1564 540 1563 541 1563 541 511 546 1557 547 505 542 511 546 505 542 20497 597 1507 545 1559 545 507 539 512 545 507 539 1564 540 512 545 1558 546 1558 546 1558 546 1557 547 505 542 1562 542 510 547 505 542 510 547 20492 540 1564 540 1564 540 512 545 506 540 511 546 1558 546 505 542 1562 542 1562 542 1562 542 1561 543 509 548 1555 538 514 543 509 537 514 543 20495 547 1558 546 1557 547 505 541 511 546 505 542 1562 542 510 547 1556 548 1556 548 1556 548 1556 537 514 543 1560 544 508 538 514 543 508 538 20501 541 1562 542 1562 542 510 547 505 541 510 547 1556 548 504 543 1561 543 1561 543 1560 544 1560 544 508 538 1565 539 513 544 507 539 513 544 20494 548 1556 548 1556 548 504 543 509 548 504 543 1560 544 508 539 1565 539 1565 539 1564 540 1564 540 512 545 1559 545 506 540 512 545 506 540 20499 543 1560 544 1560 544 508 539 513 544 508 538 1564 540 512 545 1559 545 1558 546 1558 546 1558 546 506 541 1563 541 510 547 505 542 510 547
#
name: VOL+
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 8430 4194 542 1562 542 1562 542 510 547 505 541 510 547 1556 548 504 542 1561 543 509 548 1556 548 1556 548 1556 548 1556 548 504 542 509 537 514 543 20496 545 1559 545 1559 545 507 539 512 545 507 539 1564 540 512 545 1559 545 507 539 1564 540 1564 540 1563 541 1563 541 511 546 506 540 511 546 20494 546 1557 547 1557 547 505 541 510 547 505 541 1562 542 510 547 1556 548 505 541 1562 542 1562 542 1561 543 1561 543 509 548 504 542 509 537 20501 540 1565 539 1565 539 512 545 507 539 512 545 1559 545 507 539 1564 540 512 545 1559 545 1558 546 1558 546 1558 546 506 540 511 546 506 540 20498 543 1562 542 1562 542 510 547 505 541 510 547 1557 547 505 541 1562 542 509 548 1556 548 1556 548 1556 548 1556 548 504 542 509 548 504 542 20497 543 1560 544 1560 544 508 538 513 544 508 538 1565 539 513 544 1560 544 508 538 1565 539 1565 539 1565 539 1564 540 513 544 507 539 512 545 20495 545 1558 546 1558 546 506 540 511 546 506 540 1563 541 511 546 1558 546 506 540 1563 541 1563 541 1563 541 1562 542 510 547 505 541 510 547 20493 548 1556 548 1556 548 504 542 509 548 504 542 1561 543 509 537 1566 538 514 543 1560 544 1560 544 1560 544 1560 544 508 538 513 544 508 538 20501 539 1564 540 1564 540 512 545 507 539 512 545 1559 545 507 539 1564 540 512 545 1559 545 1558 546 1558 546 1558 546 506 540 511 546 506 540
#
name: VOL-
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 8434 4191 545 1559 545 1559 545 534 512 513 544 507 539 1564 540 538 519 1559 545 1558 546 1558 546 1558 546 1558 546 1558 546 533 513 511 546 506 540 19446 547 1557 547 1557 547 532 514 511 546 532 514 1562 593 459 546 1557 547 1557 547 1557 547 1557 547 1557 547 1557 547 531 515 510 547 505 541 19446 548 1556 548 1556 548 530 516 509 548 504 543 1561 543 535 512 1566 538 1565 539 1565 539 1565 539 1565 539 1565 539 540 517 509 537 514 543 19444 539 1565 539 1565 539 513 544 508 538 513 544 1559 545 534 512 1564 540 1564 540 1564 540 1564 540 1564 540 1564 540 539 518 507 539 513 544 19442 541 1563 541 1563 541 538 519 507 539 512 545 1558 546 506 540 1563 541 1563 541 1563 541 1563 541 1563 541 1562 542 537 520 505 541 511 546 19440 595 1509 543 1561 543 536 521 504 542 509 548 1555 538 540 517 1560 544 1560 544 1560 544 1560 544 1560 544 1560 544 534 512 513 544 508 538 19448 546 1559 545 1559 545 533 513 512 545 507 539 1563 541 538 519 1558 546 1558 546 1558 546 1557 547 1558 546 1558 546 533 513 512 545 506 540 19447 546 1557 547 1557 547 532 514 511 546 506 540 1562 542 537 520 1557 547 1557 547 1557 547 1557 547 1557 547 1557 547 505 542 510 547 505 541 19445 548 1556 548 1556 548 531 515 510 547 504 542 1561 543 536 521 1555 538 1566 538 1566 538 1566 538 1566 538 1565 539 514 543 509 537 514 543
#
name: MUTE
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 8435 4189 547 1557 547 1557 547 505 541 510 547 505 541 1562 542 510 547 1557 547 505 541 510 547 1557 546 1557 547 1557 547 505 541 510 547 505 541 21550 547 1558 545 1558 546 506 540 511 546 506 540 1563 541 511 546 1558 545 506 540 511 546 1558 546 1558 546 1558 546 506 540 511 546 506 540 21551 546 1558 546 1558 546 506 540 512 545 506 540 1563 540 512 545 1558 546 506 540 512 545 1558 546 1558 546 1558 546 506 540 512 545 506 540 21551 546 1559 545 1559 545 507 539 512 545 507 539 1564 539 512 545 1559 545 507 539 512 545 1559 545 1559 545 1559 545 507 539 512 545 507 539 21552 545 1559 545 1559 545 507 539 513 544 507 539 1564 540 512 545 1559 545 507 539 512 545 1559 545 1559 545 1559 545 507 539 512 545 507 539 21552 545 1559 545 1559 545 507 539 513 544 507 539 1565 538 513 544 1559 545 507 539 513 544 1559 545 1559 544 1559 545 534 512 513 544 507 539 21553 544 1560 544 1560 544 534 512 513 544 508 538 1565 539 539 518 1560 544 534 512 513 544 1560 544 1560 544 1560 544 534 512 513 544 508 538
#

0 comments on commit 9ff35c9

Please sign in to comment.