Compare commits

...

16 Commits

Author SHA1 Message Date
jLynx
e26d026216 Merge pull request #536 from jLynx/gen1
Fixed R1_20150901 vs R2_20170522 boot & detection issues. Read up about it here https://github.com/eried/portapack-mayhem/wiki/Won't-boot
2022-04-06 13:52:00 +12:00
jLynx
0c0d47b0d2 Added persistent memory of save state 2022-04-06 13:28:10 +12:00
jLynx
50821bab55 Added button on boot detection 2022-04-06 08:16:57 +12:00
jLynx
796d9ca854 Updated comments 2022-04-05 14:44:32 +12:00
jLynx
fd8bc177ad Added support for H2+ 2022-04-05 14:41:12 +12:00
jLynx
eab832396b Merge pull request #537 from jLynx/flashing
Added flashing tools
2022-04-05 11:14:16 +12:00
jLynx
3bb7ba59ae Added flashing tools 2022-04-05 11:13:12 +12:00
jLynx
f6c496d1d3 removed comments 2022-04-05 10:56:09 +12:00
jLynx
b4a6b958e5 Fixed R1_20150901 vs R2_20170522 boot & detection issues 2022-04-05 10:53:52 +12:00
jLynx
43e9ce4704 Fixed R1_20150901 vs R2_20170522 boot & detection issues 2022-04-05 10:52:42 +12:00
Erwin Ried
b4e5fb7483 Merge pull request #534 from jLynx/changelog
Added changelog to release notes v2
2022-04-04 12:03:14 +02:00
jLynx
29d3a0f1dd Added python script to parse changelog 2022-04-04 09:00:41 +12:00
jLynx
1e413d034f WIP python 2022-04-04 08:54:43 +12:00
jLynx
5627634da1 Removed usernames for the moment 2022-04-04 07:33:14 +12:00
jLynx
719e7d42fd Removed usernames for the moment 2022-04-04 07:32:55 +12:00
jLynx
71d9fd1c87 Update with next 2022-04-04 07:15:24 +12:00
21 changed files with 182 additions and 31 deletions

28
.github/workflows/changelog.py vendored Normal file
View File

@@ -0,0 +1,28 @@
import os
import re
import sys
raw_git = os.popen('git log next --since="24 hours" --pretty=format:"- %h - {USERNAME}*+%al-%an*: %s"').read()
def compute_username(line):
stripped = re.search(r'(?<=\*)(.*?)(?=\*)', line).group(0)
pattern = re.compile("[$@+&?].*[$@+&?]")
if pattern.match(stripped):
stripped = re.sub("[$@+&?].*[$@+&?]", "", stripped)
stripped = re.match(r'.+?(?=-)', stripped).group(0)
else:
stripped = re.sub(r'^.*?-', "", stripped)
return "@" + stripped
def compile_line(line):
username = compute_username(line)
line = re.sub(r'[*].*[*]', "", line)
line = line.replace("{USERNAME}", username)
return line
for row in raw_git.splitlines():
print(compile_line(row))

View File

@@ -35,6 +35,7 @@ jobs:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
ref: next
submodules: true
- name: Git Sumbodule Update
@@ -52,6 +53,14 @@ jobs:
- name: Create SD Card ZIP
run: |
zip -r sdcard.zip sdcard
- name: Create changelog
run: |
CHANGELOG=$(python3 .github/workflows/changelog.py)
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=content::$CHANGELOG"
id: changelog
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -59,12 +68,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly-tag-${{ steps.date.outputs.date }}
release_name: Nightly-release - ${{ 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.
Version: ${{ steps.version_date.outputs.date }}
You can find the changes in this commit ${{ github.sha }}
## Release notes
### Revision (${{ steps.version_date.outputs.date }}):
${{ steps.changelog.outputs.content }}
draft: false
prerelease: true
- name: Upload Firmware Asset
@@ -85,5 +95,5 @@ jobs:
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
asset_name: mayhem_nightly_${{ steps.version_date.outputs.date }}_COPY_TO_SDCARD.zip
asset_content_type: application/zip

View File

@@ -169,7 +169,7 @@ int main(void) {
sdcStart(&SDCD1, nullptr);
controls_init();
// controls_init(); // Commented out as now happens in portapack.cpp
lcd_frame_sync_configure();
rtc_interrupt_enable();

View File

@@ -29,6 +29,7 @@
#include "hackrf_gpio.hpp"
using namespace hackrf::one;
#include "clock_manager.hpp"
#include "event_m0.hpp"
@@ -45,6 +46,7 @@ using asahi_kasei::ak4951::AK4951;
#include "cpld_update.hpp"
#include "optional.hpp"
#include "irq_controls.hpp"
namespace portapack {
@@ -179,18 +181,19 @@ static PortaPackModel portapack_model() {
static Optional<PortaPackModel> model;
if( !model.is_valid() ) {
/*For the time being, it is impossible to distinguish the hardware of R1 and R2 from the software level*/
/*At this point, I2c is not ready.*/
//if( audio_codec_wm8731.detected() ) {
// model = PortaPackModel::R1_20150901;
//} else {
model = PortaPackModel::R2_20170522;
//}
if( audio_codec_wm8731.detected() ) {
model = PortaPackModel::R1_20150901; // H1R1
} else {
model = PortaPackModel::R2_20170522; // H1R2, H2+
}
}
return model.value();
}
//audio_codec_wm8731 = H1R1 & H2+
//audio_codec_ak4951 = H1R2
static audio::Codec* portapack_audio_codec() {
/* I2C ready OK, Automatic recognition of audio chip */
return (audio_codec_wm8731.detected())
@@ -200,16 +203,34 @@ static audio::Codec* portapack_audio_codec() {
}
static const portapack::cpld::Config& portapack_cpld_config() {
const auto switches_state = get_switches_state();
if (switches_state[(size_t)ui::KeyEvent::Up]){
persistent_memory::set_config_cpld(1);
return portapack::cpld::rev_20170522::config;
}
if (switches_state[(size_t)ui::KeyEvent::Down]){
persistent_memory::set_config_cpld(2);
return portapack::cpld::rev_20150901::config;
}
if (switches_state[(size_t)ui::KeyEvent::Select]){
persistent_memory::set_config_cpld(0);
}
if (portapack::persistent_memory::config_cpld() == 1) {
return portapack::cpld::rev_20170522::config;
} else if (portapack::persistent_memory::config_cpld() == 2) {
return portapack::cpld::rev_20150901::config;
}
return (portapack_model() == PortaPackModel::R2_20170522)
? portapack::cpld::rev_20170522::config
: portapack::cpld::rev_20150901::config
;
? portapack::cpld::rev_20170522::config
: portapack::cpld::rev_20150901::config;
}
Backlight* backlight() {
return (portapack_model() == PortaPackModel::R2_20170522)
? static_cast<portapack::Backlight*>(&backlight_cat4004)
: static_cast<portapack::Backlight*>(&backlight_on_off);
? static_cast<portapack::Backlight*>(&backlight_cat4004) // R2_20170522
: static_cast<portapack::Backlight*>(&backlight_on_off); // R1_20150901
}
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
@@ -318,14 +339,15 @@ bool init() {
i2c0.start(i2c_config_boot_clock);
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
shutdown_base();
return false;
}
// Keeping this here for now incase we need to revert
// if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
// shutdown_base();
// return false;
// }
if( !hackrf::cpld::load_sram() ) {
chSysHalt();
}
// if( !hackrf::cpld::load_sram() ) {
// chSysHalt();
// }
configure_pins_portapack();
@@ -377,20 +399,30 @@ bool init() {
i2c0.start(i2c_config_fast_clock);
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
touch::adc::init();
controls_init();
audio::init(portapack_audio_codec());
clock_manager.set_reference_ppb(persistent_memory::correction_ppb());
clock_manager.enable_first_if_clock();
clock_manager.enable_second_if_clock();
clock_manager.enable_codec_clocks();
radio::init();
touch::adc::init();
radio::init();
LPC_CREG->DMAMUX = portapack::gpdma_mux;
gpdma::controller.enable();
audio::init(portapack_audio_codec());
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
shutdown_base();
return false;
}
if( !hackrf::cpld::load_sram() ) {
chSysHalt();
}
return true;
}

View File

@@ -115,6 +115,10 @@ void AK4951::init() {
// update(Register::DigitalFilterMode);
}
bool AK4951::detected() {
return reset();
}
bool AK4951::reset() {
io.audio_reset_state(true);

View File

@@ -823,6 +823,8 @@ public:
std::string name() const override {
return "AK4951";
}
bool detected();
void init() override;
bool reset() override;

View File

@@ -82,6 +82,9 @@ struct data_t {
int32_t afsk_space_freq;
int32_t modem_baudrate;
int32_t modem_repeat;
// Hardware
uint32_t hardware_config;
// Play dead unlock
uint32_t playdead_magic;
@@ -254,6 +257,10 @@ bool config_splash() {
return data->ui_config & (1 << 31);
}
uint8_t config_cpld() {
return data->hardware_config;
}
uint32_t config_backlight_timer() {
const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 };
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
@@ -287,6 +294,10 @@ void set_config_splash(bool v) {
data->ui_config = (data->ui_config & ~(1 << 31)) | (v << 31);
}
void set_config_cpld(uint8_t i) {
data->hardware_config = i;
}
void set_config_backlight_timer(uint32_t i) {
data->ui_config = (data->ui_config & ~7) | (i & 7);
}

View File

@@ -74,6 +74,9 @@ void set_playdead_sequence(const uint32_t new_value);
bool stealth_mode();
void set_stealth_mode(const bool v);
uint8_t config_cpld();
void set_config_cpld(uint8_t i);
bool config_splash();
bool hide_clock();
bool clock_with_date();

View File

@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/eried/portapack-mayhem/releases

View File

@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/eried/portapack-mayhem/wiki/Update-firmware

1
flashing/README.txt Normal file
View File

@@ -0,0 +1 @@
Plug HackRF+Portapack, set it in HackRF mode, launch flash_portapack_mayhem.bat

View File

@@ -0,0 +1,19 @@
@echo off
echo *** Run HackRF firmware in RAM via LPC DFU ***
echo.
echo This is used to "unbrick" your HackRF, if you are no longer able to use
echo HackRF tools to flash or operate your HackRF.
echo.
echo Connect your HackRF One to a USB port on your computer.
echo.
echo Hold down both the DFU and RESET buttons on the HackRF.
echo Then release the RESET button (closest to the edge).
echo Then release the DFU button.
echo.
pause
echo.
dfu-util-static.exe --device 1fc9:000c --download hackrf_one_usb.dfu --reset
echo.
pause

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" ?>
<dpinst>
<deleteBinaries/>
<installAllOrNone/>
<suppressAddRemovePrograms/>
<suppressWizard/>
</dpinst>

Binary file not shown.

Binary file not shown.

BIN
flashing/driver/lpc_dfu.inf Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,15 @@
@echo off
echo *** Re-flash the HackRF with HackRF firmware ***
echo.
echo Connect your HackRF One to a USB port on your computer.
echo.
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
echo the "HackRF" option from the main menu.
echo.
pause
echo.
hackrf_update.exe hackrf_one_usb.bin
echo.
pause

View File

@@ -0,0 +1,15 @@
@echo off
echo *** Re-flash the HackRF with PortaPack firmware ***
echo.
echo Connect your HackRF One to a USB port on your computer.
echo.
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
echo the "HackRF" option from the main menu.
echo.
pause
echo.
hackrf_update.exe portapack-h1_h2-mayhem.bin
echo.
pause

BIN
flashing/hackrf_one_usb.bin Normal file

Binary file not shown.

BIN
flashing/hackrf_one_usb.dfu Normal file

Binary file not shown.