mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-14 18:43:01 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 400cccdcc1 | |||
| 5577ec82ed | |||
| da98e7739e | |||
| b5b5bf42af | |||
| 587fbfbbb1 | |||
| c54e382db2 | |||
| 22de89c879 | |||
| aa778e5797 | |||
| e8e98475e2 | |||
| 95d1bca9fd | |||
| 1a5c360efe | |||
| 560c7143bf | |||
| 6fc03a2651 | |||
| f31ee1172d | |||
| 996e648a64 | |||
| ca4f68d24a | |||
| c9657bc92b | |||
| b8d98e4f45 |
@@ -49,6 +49,8 @@ You can write [documentation](https://github.com/eried/portapack-mayhem/wiki), f
|
||||
|
||||
Consider that the hardware and firmware has been created and maintain by a [lot](https://github.com/mossmann/hackrf/graphs/contributors) of [people](https://github.com/eried/portapack-mayhem/graphs/contributors), so always try colaborating your time and effort first. For coding related questions, if something does not fit as an issue, please join our Discord by clicking the chat badge on [top](#portapack-mayhem).
|
||||
|
||||
[](https://github.com/eried/portapack-mayhem/graphs/contributors)
|
||||
|
||||
As a last option, if you want to send money directly to me for getting more boards, antennas and such:
|
||||
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CBPQA4HRRPJQ6&source=url)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "ui_fileman.hpp"
|
||||
#include "io_file.hpp"
|
||||
|
||||
#include "cpld_update.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "portapack.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
@@ -258,7 +258,12 @@ ReplayAppView::ReplayAppView(
|
||||
|
||||
ReplayAppView::~ReplayAppView() {
|
||||
radio::disable();
|
||||
baseband::shutdown();
|
||||
|
||||
display.fill_rectangle({ 0,0,240, 320 },Color::black()); //Solving sometimes visible bottom waterfall artifacts, clearing all LCD pixels.
|
||||
chThdSleepMilliseconds(40); // (that happened sometimes if we interrupt the waterfall play at the beggining of the play around 25% and exit )
|
||||
hackrf::cpld::load_sram_no_verify(); // to leave all RX reception ok, without "ghost interference signal problem" at the exit .
|
||||
|
||||
baseband::shutdown(); // better this function at the end, after load_sram(). If not , sometimes produced hang up (now not , it is ok).
|
||||
}
|
||||
|
||||
void ReplayAppView::on_hide() {
|
||||
|
||||
@@ -270,9 +270,9 @@ void JammerView::start_tx() {
|
||||
button_transmit.set_text("STOP");
|
||||
|
||||
transmitter_model.set_sampling_rate(3072000U);
|
||||
transmitter_model.set_rf_amp(true);
|
||||
transmitter_model.set_rf_amp(field_amp.value());
|
||||
transmitter_model.set_baseband_bandwidth(3500000U);
|
||||
transmitter_model.set_tx_gain(47);
|
||||
transmitter_model.set_tx_gain(field_gain.value());
|
||||
transmitter_model.enable();
|
||||
|
||||
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
@@ -368,6 +368,8 @@ JammerView::JammerView(
|
||||
&field_timetx,
|
||||
&field_timepause,
|
||||
&field_jitter,
|
||||
&field_gain,
|
||||
&field_amp,
|
||||
&button_transmit
|
||||
});
|
||||
|
||||
@@ -382,6 +384,8 @@ JammerView::JammerView(
|
||||
|
||||
field_timetx.set_value(30);
|
||||
field_timepause.set_value(1);
|
||||
field_gain.set_value(transmitter_model.tx_gain());
|
||||
field_amp.set_value(transmitter_model.rf_amp());
|
||||
|
||||
button_transmit.on_select = [this](Button&) {
|
||||
if (jamming || cooling)
|
||||
|
||||
@@ -156,7 +156,9 @@ private:
|
||||
{ { 0 * 8, 33 * 8 }, "Jitter:", Color::light_grey() }, //Maybe the repository curator can keep the "mystype" for some versions.
|
||||
{ { 11 * 8, 29 * 8 }, "Secs.", Color::light_grey() },
|
||||
{ { 11 * 8, 31 * 8 }, "Secs.", Color::light_grey() },
|
||||
{ { 11 * 8, 33 * 8 }, "/60", Color::light_grey() }
|
||||
{ { 11 * 8, 33 * 8 }, "/60", Color::light_grey() },
|
||||
{ { 2 * 8, 35 * 8 }, "Gain:", Color::light_grey() },
|
||||
{ { 11 * 8, 35 * 8 }, "A:", Color::light_grey() }
|
||||
};
|
||||
|
||||
OptionsField options_type {
|
||||
@@ -229,8 +231,24 @@ private:
|
||||
' ',
|
||||
};
|
||||
|
||||
NumberField field_gain {
|
||||
{ 8 * 8, 35 * 8 },
|
||||
2,
|
||||
{ 0, 47 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
NumberField field_amp {
|
||||
{ 13 * 8, 35 * 8 },
|
||||
1,
|
||||
{ 0, 1 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
Button button_transmit {
|
||||
{ 148, 212, 80, 80},
|
||||
{ 148, 216, 80, 80},
|
||||
"START"
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#
|
||||
# Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
||||
@@ -80,7 +80,7 @@ def print_block(block):
|
||||
for n in range(0, len(block), 8):
|
||||
chunk = block[n:n+8]
|
||||
line = ['0x%04x,' % v for v in chunk]
|
||||
print('\t%s' % ' '.join(line))
|
||||
print(('\t%s' % ' '.join(line)))
|
||||
|
||||
def crc32(blocks):
|
||||
import zlib
|
||||
@@ -92,7 +92,7 @@ def crc32(blocks):
|
||||
crc_bytes.append((word >> 8) & 0xff)
|
||||
return zlib.crc32(bytearray(crc_bytes)) & 0xffffffff
|
||||
|
||||
print("""#include "portapack_cpld_data.hpp"
|
||||
print(("""#include "portapack_cpld_data.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
@@ -100,23 +100,23 @@ print("""#include "portapack_cpld_data.hpp"
|
||||
namespace portapack {
|
||||
namespace cpld {
|
||||
namespace %s {
|
||||
""" % revision_name)
|
||||
""" % revision_name))
|
||||
|
||||
print('const std::array<uint16_t, %d> block_0 { {' % len(block_0))
|
||||
print(('const std::array<uint16_t, %d> block_0 { {' % len(block_0)))
|
||||
print_block(block_0)
|
||||
|
||||
print("""} };
|
||||
""")
|
||||
|
||||
print('const std::array<uint16_t, %d> block_1 { {' % len(block_1))
|
||||
print(('const std::array<uint16_t, %d> block_1 { {' % len(block_1)))
|
||||
print_block(block_1)
|
||||
|
||||
print("""} };
|
||||
print(("""} };
|
||||
|
||||
} /* namespace %s */
|
||||
} /* namespace cpld */
|
||||
} /* namespace portapack */
|
||||
""" % revision_name)
|
||||
""" % revision_name))
|
||||
|
||||
if calculate_crc:
|
||||
# Apply post-programming modification to make post-programming CRC correct:
|
||||
@@ -124,4 +124,4 @@ if calculate_crc:
|
||||
programmed_block_0[0] &= 0xfbff
|
||||
|
||||
crc = crc32((programmed_block_0, block_1))
|
||||
print('%08x' % crc)
|
||||
print(('%08x' % crc))
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import math
|
||||
|
||||
m = 64 - 1
|
||||
@@ -6,7 +8,7 @@ ft = 300.0 / 24000.0
|
||||
taps = []
|
||||
window = []
|
||||
|
||||
print("Normalized ft = " + str(ft))
|
||||
print(("Normalized ft = " + str(ft)))
|
||||
|
||||
for n in range(0, 64):
|
||||
taps.append(math.sin(2 * math.pi * ft * (n - (m / 2.0))) / (math.pi * (n - (m / 2.0))))
|
||||
|
||||
@@ -29,10 +29,10 @@ outfile = open('../../sdcard/ADSB/world_map.bin', 'wb')
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
im = Image.open("../../sdcard/ADSB/world_map.jpg")
|
||||
pix = im.load()
|
||||
|
||||
outfile.write(struct.pack('H', im.size[0]))
|
||||
outfile.write(struct.pack('H', im.size[1]))
|
||||
|
||||
# Write as unsigned short (2 bytes) as little endian
|
||||
outfile.write(struct.pack('<H', im.size[0]))
|
||||
outfile.write(struct.pack('<H', im.size[1]))
|
||||
print("image \t size[0]=" + str(im.size[0]) + "\tsize[1]=" + str(im.size[1]) + " pixels");
|
||||
print("Generating: \t" + outfile.name + "\n from\t\t" + im.filename + "\n please wait...");
|
||||
|
||||
for y in range (0, im.size[1]):
|
||||
@@ -47,8 +47,9 @@ for y in range (0, im.size[1]):
|
||||
# pixel_lcd = (pix[x, y][0] >> 5) << 5
|
||||
# pixel_lcd |= (pix[x, y][1] >> 5) << 2
|
||||
# pixel_lcd |= (pix[x, y][2] >> 6)
|
||||
line += struct.pack('H', pixel_lcd)
|
||||
line += struct.pack('<H', pixel_lcd)
|
||||
outfile.write(line)
|
||||
print(str(y) + '/' + str(im.size[1]) + '\r', end="")
|
||||
|
||||
outfile.close();
|
||||
print("Ready.");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2016 Furrtek
|
||||
#
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2016 Furrtek
|
||||
#
|
||||
@@ -42,7 +42,7 @@ def convert_png(file):
|
||||
rgb_im = im.convert('RGBA')
|
||||
|
||||
if rgb_im.size[0] % 8 or rgb_im.size[1] % 8:
|
||||
print(file + ": Size isn\'t a multiple of 8")
|
||||
print((file + ": Size isn\'t a multiple of 8"))
|
||||
sys.exit(-1)
|
||||
|
||||
name = path.basename(file).split(".")[0].lower();
|
||||
@@ -112,4 +112,4 @@ f.write("\n")
|
||||
f.write("} /* namespace ui */\n\n")
|
||||
f.write("#endif/*__BITMAP_HPP__*/\n")
|
||||
|
||||
print("Converted " + str(count) + " files")
|
||||
print(("Converted " + str(count) + " files"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2016 Furrtek
|
||||
#
|
||||
@@ -40,4 +40,4 @@ for c in range (0, 0x200): # DCS code is 9 bits
|
||||
p10 = cb[3] ^ cb[5] ^ cb[6] ^ cb[8] ^ 1;
|
||||
p11 = cb[0] ^ cb[1] ^ cb[2] ^ cb[3] ^ cb[6] ^ 1;
|
||||
|
||||
print ' 0b{0:011b}'.format((p11<<10) | (p10<<9) | (p9<<8) |(p8<<7) | (p7<<6) | (p6<<5) | (p5<<4) | (p4<<3) | (p3<<2) | (p2<<1) | (p1)) + ', // ' + str(c);
|
||||
print(' 0b{0:011b}'.format((p11<<10) | (p10<<9) | (p9<<8) |(p8<<7) | (p7<<6) | (p6<<5) | (p5<<4) | (p4<<3) | (p3<<2) | (p2<<1) | (p1)) + ', // ' + str(c));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#
|
||||
# Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#
|
||||
# Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
|
||||
Reference in New Issue
Block a user