Merge branch 'eried:next' into next

This commit is contained in:
Brumi-2021 2022-04-02 13:23:43 +02:00 committed by GitHub
commit 1976c3648b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 134 additions and 6 deletions

View File

@ -0,0 +1,71 @@
# ToDo: only trigger after 24 hours if there are actually changes: https://github.community/t/trigger-action-on-schedule-only-if-there-are-changes-to-the-branch/17887/4
name: Nightly Release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Checkout
uses: actions/checkout@master
with:
ref: next
submodules: true
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
- name: Build the Docker image
run: docker build -t portapack-dev -f dockerfile-nogit . --tag my-image-name:$(date +%s)
- name: Make build folder
run: mkdir ${{ github.workspace }}/build
- name: Run the Docker image
run: docker run -i -v ${{ github.workspace }}:/havoc portapack-dev
- name: Create Firmware ZIP
run: |
zip --junk-paths firmware build/firmware/portapack-h1_h2-mayhem.bin
- name: Create SD Card ZIP
run: |
zip -r sdcard.zip sdcard
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly-tag-${{ steps.date.outputs.date }}
release_name: Nightly-release - ${{ steps.date.outputs.date }}
body: |
**Nightly release - ${{ steps.date.outputs.date }}**
This build is the latest and greatest, although may not be the most stable as this is a nightly release.
You can find the changes in this commit ${{ github.sha }}
draft: false
prerelease: true
- name: Upload Firmware Asset
id: upload-firmware-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./firmware.zip
asset_name: mayhem_nightly_${{ steps.date.outputs.date }}_FIRMWARE.zip
asset_content_type: application/zip
- name: Upload SD Card Assets
id: upload-sd-card-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sdcard.zip
asset_name: mayhem_nightly_${{ steps.date.outputs.date }}_COPY_TO_SDCARD.zip
asset_content_type: application/zip

View File

@ -129,6 +129,9 @@ AnalogAudioView::AnalogAudioView(
&waterfall &waterfall
}); });
//Filename Datetime and Frequency
record_view.set_filename_date_frequency(true);
field_frequency.set_value(receiver_model.tuning_frequency()); field_frequency.set_value(receiver_model.tuning_frequency());
field_frequency.set_step(receiver_model.frequency_step()); field_frequency.set_step(receiver_model.frequency_step());
field_frequency.on_change = [this](rf::Frequency f) { field_frequency.on_change = [this](rf::Frequency f) {

View File

@ -28,11 +28,11 @@
#include "ui_receiver.hpp" #include "ui_receiver.hpp"
#include "ui_spectrum.hpp" #include "ui_spectrum.hpp"
#include "ui_record_view.hpp" #include "ui_record_view.hpp"
#include "ui_font_fixed_8x16.hpp" #include "ui_font_fixed_8x16.hpp"
#include "tone_key.hpp" #include "tone_key.hpp"
namespace ui { namespace ui {
constexpr Style style_options_group { constexpr Style style_options_group {
@ -216,7 +216,10 @@ private:
RecordView record_view { RecordView record_view {
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 }, { 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
u"AUD_????", RecordView::FileType::WAV, 4096, 4 u"AUD",
RecordView::FileType::WAV,
4096,
4
}; };
spectrum::WaterfallWidget waterfall { true }; spectrum::WaterfallWidget waterfall { true };

View File

@ -136,7 +136,7 @@ private:
3, 3,
{ {
{ "315", 315000000 }, { "315", 315000000 },
{ "434", 433920000 }, { "433", 433920000 },
} }
}; };

View File

@ -37,7 +37,8 @@ namespace ui
console.writeln("vXxOinvizioNxX,teixeluis"); console.writeln("vXxOinvizioNxX,teixeluis");
console.writeln("Brumi-2021,texasyojimbo"); console.writeln("Brumi-2021,texasyojimbo");
console.writeln("heurist1,intoxsick,ckuethe"); console.writeln("heurist1,intoxsick,ckuethe");
console.writeln("notpike"); console.writeln("notpike,jLynx,zigad");
console.writeln("MichalLeonBorsuk");
console.writeln(""); console.writeln("");
break; break;

View File

@ -129,6 +129,11 @@ std::string to_string_decimal(float decimal, int8_t precision) {
return result; return result;
} }
std::string to_string_freq(const uint64_t f) {
auto final_str = to_string_dec_int(f / 1000000,4) + to_string_dec_int(f % 1000000, 6, '0');
return final_str;
}
std::string to_string_short_freq(const uint64_t f) { std::string to_string_short_freq(const uint64_t f) {
auto final_str = to_string_dec_int(f / 1000000,4) + "." + to_string_dec_int((f / 100) % 10000, 4, '0'); auto final_str = to_string_dec_int(f / 1000000,4) + "." + to_string_dec_int((f / 100) % 10000, 4, '0');
return final_str; return final_str;

View File

@ -48,6 +48,7 @@ std::string to_string_decimal(float decimal, int8_t precision);
std::string to_string_hex(const uint64_t n, const int32_t l = 0); std::string to_string_hex(const uint64_t n, const int32_t l = 0);
std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0); std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0);
std::string to_string_freq(const uint64_t f);
std::string to_string_short_freq(const uint64_t f); std::string to_string_short_freq(const uint64_t f);
std::string to_string_time_ms(const uint32_t ms); std::string to_string_time_ms(const uint32_t ms);

View File

@ -212,7 +212,7 @@ namespace ui
void refresh(); void refresh();
private: private:
static constexpr auto version_string = "v1.4.3"; static constexpr auto version_string = "v1.4.4";
NavigationView &nav_; NavigationView &nav_;
Rectangle backdrop{ Rectangle backdrop{

View File

@ -127,6 +127,11 @@ void RecordView::set_sampling_rate(const size_t new_sampling_rate) {
} }
} }
// Setter for datetime and frequency filename
void RecordView::set_filename_date_frequency(bool set) {
filename_date_frequency = set;
}
bool RecordView::is_active() const { bool RecordView::is_active() const {
return (bool)capture_thread; return (bool)capture_thread;
} }
@ -149,7 +154,24 @@ void RecordView::start() {
return; return;
} }
auto base_path = next_filename_stem_matching_pattern(filename_stem_pattern);
std::filesystem::path base_path;
if(filename_date_frequency) {
rtcGetTime(&RTCD1, &datetime);
//ISO 8601
std::string date_time = to_string_dec_uint(datetime.year(), 4, '0') +
to_string_dec_uint(datetime.month(), 2, '0') +
to_string_dec_uint(datetime.day(), 2, '0') + "T" +
to_string_dec_uint(datetime.hour()) +
to_string_dec_uint(datetime.minute()) +
to_string_dec_uint(datetime.second());
base_path = filename_stem_pattern.string() + "_" + date_time + "_" + to_string_freq(receiver_model.tuning_frequency()) + "Hz";
} else {
base_path = next_filename_stem_matching_pattern(filename_stem_pattern);
}
if( base_path.empty() ) { if( base_path.empty() ) {
return; return;
} }

View File

@ -63,6 +63,8 @@ public:
bool is_active() const; bool is_active() const;
void set_filename_date_frequency(bool set);
private: private:
void toggle(); void toggle();
//void toggle_pitch_rssi(); //void toggle_pitch_rssi();
@ -75,6 +77,11 @@ private:
void handle_error(const File::Error error); void handle_error(const File::Error error);
//bool pitch_rssi_enabled = false; //bool pitch_rssi_enabled = false;
// Time Stamp
bool filename_date_frequency = false;
rtc::RTC datetime { };
const std::filesystem::path filename_stem_pattern; const std::filesystem::path filename_stem_pattern;
const FileType file_type; const FileType file_type;
const size_t write_size; const size_t write_size;

Binary file not shown.

11
sdcard/SAMPLES/README.md Normal file
View File

@ -0,0 +1,11 @@
# Files for Replay app
Sample files below can be used with Replay app.
See [Wiki](https://github.com/eried/portapack-mayhem/wiki/C16-format) for more info over C16 file format.
| file | description | frequency |
| ------ | ------ | ------: |
| [HamptonBayFanOnOff.C16](HamptonBayFanOnOff.C16) | Switches Hampton Bay fan on/off. |304.175 Mhz |
| [TeslaChargePort_EU_AU.C16](TeslaChargePort_EU_AU.C16) | Opens a Tesla charge door. This version is for non-US Tesla cars operating at 433MHz. | 433.95 Mhz |
| [TeslaChargePort_US.C16](TeslaChargePort_US.C16) | Opens a Tesla charge door. This version is for US Tesla cars operating at 315MHz. |315 Mhz |

Binary file not shown.

View File

@ -0,0 +1,2 @@
sample_rate=500000
center_frequency=433950000

Binary file not shown.

View File

@ -0,0 +1,2 @@
sample_rate=500000
center_frequency=315000000