Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev ARQ (retransmit) #185

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c48ddb1
1st
olliw42 May 24, 2024
d07e8e3
2nd, seems ok
olliw42 May 24, 2024
062b73a
nfc
olliw42 May 24, 2024
f43d224
change to ack with last received seq no
olliw42 May 27, 2024
67e45e5
ups
olliw42 May 27, 2024
19c5402
rx, previous frame handling corrected
olliw42 May 28, 2024
6d1ee37
Merge branch 'main' into dev-arq
olliw42 May 28, 2024
325d3c8
Merge branch 'main' into dev-arq
olliw42 May 28, 2024
197c44d
tx, correct mavlink parser reset
olliw42 May 28, 2024
4ea70dd
some streamlining, preperation
olliw42 May 29, 2024
d83bb71
more
olliw42 May 29, 2024
5e0f0c7
separate out error simulator
olliw42 May 30, 2024
fecd1d5
attempt at retry cnt
olliw42 May 30, 2024
19d4fe7
comment, nfc
olliw42 May 30, 2024
432324a
Merge branch 'main' into dev-arq
olliw42 May 31, 2024
f0204e1
that's strange, memset seems to fail if not unit8/char
olliw42 May 31, 2024
dab1168
rx, slight rearrangment, tidies
olliw42 May 31, 2024
3a00326
Merge branch 'main' into dev-arq
olliw42 Jun 1, 2024
b03ec59
Merge branch 'main' into dev-arq
olliw42 Jun 2, 2024
2a42d4d
rx, let flow control respect frame transmission rate, rx, adjust arq …
olliw42 Jun 3, 2024
f8636d1
tx, mavlink, add seq-based LQ metric
olliw42 Jun 5, 2024
5890cf0
Merge branch 'main' into dev-arq
olliw42 Jun 5, 2024
0f0754f
Merge branch 'main' into dev-arq
olliw42 Jun 6, 2024
75f4d30
Merge branch 'main' into dev-arq
olliw42 Jun 6, 2024
3f6b82b
Merge branch 'main' into dev-arq
olliw42 Jun 6, 2024
6e24f98
Merge branch 'main' into dev-arq
olliw42 Jun 7, 2024
2988cf5
rx, arq, more retries for 111Hz mode
olliw42 Jun 7, 2024
e2e0d7f
add compiled binaries
olliw42 Jun 7, 2024
1accf76
tx, arq, some (incomplete) improvements on frame lost
olliw42 Jun 8, 2024
25a423a
arq, framelost via limited seq_no attempt
olliw42 Jun 10, 2024
b0a7d7d
Merge branch 'main' into dev-arq
olliw42 Jun 11, 2024
3384f4a
remove sender side restriction to seq_no advancement. Add/keep simple…
olliw42 Jun 11, 2024
609eb22
update precompiled binaries
olliw42 Jun 12, 2024
bcd6c90
test, scan payload for marker
olliw42 Jun 12, 2024
5f43fc8
Merge branch 'main' into dev-arq
olliw42 Jun 20, 2024
30fce69
sync
olliw42 Jun 21, 2024
9d17218
new pre compiled
olliw42 Jun 21, 2024
b39c98b
Merge branch 'main' into dev-arq
olliw42 Jun 22, 2024
aa4c41f
precompiled
olliw42 Jun 22, 2024
37a4ab8
Merge branch 'main' into dev-arq
olliw42 Jun 25, 2024
3106187
cc
olliw42 Jun 28, 2024
517e8d9
Merge branch 'main' into dev-arq
olliw42 Jun 28, 2024
4b5971e
cc
olliw42 Jun 28, 2024
6df029a
Merge branch 'main' into dev-arq
olliw42 Jul 16, 2024
286d991
Merge branch 'main' into dev-arq
olliw42 Jul 19, 2024
ed4f274
formatting
olliw42 Jul 19, 2024
5bf51c8
tx, tasks revised, ups
olliw42 Jul 20, 2024
5048328
common, tidy, nfc
olliw42 Jul 20, 2024
1541f4f
rx, remove buzzer setting
olliw42 Jul 20, 2024
d861793
rx,tx, hal, separate out generic power configs, nfc
olliw42 Jul 20, 2024
15fd452
Merge branch 'main' into dev-arq
olliw42 Jul 20, 2024
ac527f9
cube, ld scripts etc to v1.16.0
olliw42 Jul 20, 2024
01ac320
cube, ld scripts etc to v1.16.0 for wle
olliw42 Jul 20, 2024
6e8e77e
cube, ld scripts etc to v1.16.0 for f072
olliw42 Jul 20, 2024
bd15cb1
cube, ld scripts etc to v1.16.0 for R9 systems
olliw42 Jul 20, 2024
843e6d4
cube, ld scripts etc to v1.16.0 for f103cb
olliw42 Jul 20, 2024
9b900f3
mavlinkX, drop a warning with gcc12
olliw42 Jul 20, 2024
b20b9a5
Merge branch 'main' into dev-arq
olliw42 Jul 21, 2024
d69c5b4
some doc
olliw42 Jul 21, 2024
e74735a
tidy, nfc
olliw42 Jul 21, 2024
40a8cbc
try to do only rx->tx, doesn't fully work
olliw42 Jul 21, 2024
574c904
rx,common, rename tarq Receive() to AckReceive(), nfc
olliw42 Jul 21, 2024
277a3b4
tx, remove sx serial IsEnabled(), is always true, should be nfc
olliw42 Jul 21, 2024
3f24eec
rx,tx, tidy comments, nfc
olliw42 Jul 21, 2024
74d1ca2
tx, esp, remove esp cli, ser baud in init
olliw42 Jul 26, 2024
50ef52a
tx, cli, improve timing for usb, improve configid, add configid in h
olliw42 Jul 26, 2024
fcf1afd
tx, disp, a method is missing
olliw42 Jul 26, 2024
450398b
sx driver, sx1262, sx1280, allow general power calc
olliw42 Jul 26, 2024
5b0f96c
fan remove comment, nfc
olliw42 Jul 26, 2024
f0881e0
submodule stm32ll-lib update
olliw42 Jul 26, 2024
8199f4d
Merge branch 'dev-arq' into merge-main
olliw42 Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,246 changes: 3,246 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,245 changes: 3,245 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,259 changes: 3,259 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,258 changes: 3,258 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

2,677 changes: 2,677 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
3,094 changes: 3,094 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

2,963 changes: 2,963 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
2,966 changes: 2,966 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
3,017 changes: 3,017 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,136 changes: 3,136 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,285 changes: 3,285 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3,253 changes: 3,253 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

3,252 changes: 3,252 additions & 0 deletions firmware/rx-easysolder-E77-E22-dual-wle5cc-xtal-v1.2.05-dev-arq-@b39c98bc.hex

Large diffs are not rendered by default.

3,554 changes: 3,554 additions & 0 deletions firmware/rx-easysolder-E77-E28-dualband-wle5cc-v1.2.05-dev-arq-@b39c98bc.hex

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
Binary file added firmware/[email protected]
Binary file not shown.
4,923 changes: 4,923 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,922 changes: 4,922 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,935 changes: 4,935 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,934 changes: 4,934 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

6,027 changes: 6,027 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

5,127 changes: 5,127 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
4,798 changes: 4,798 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
3,388 changes: 3,388 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,921 changes: 4,921 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,993 changes: 4,993 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4,932 changes: 4,932 additions & 0 deletions firmware/[email protected]

Large diffs are not rendered by default.

4,931 changes: 4,931 additions & 0 deletions firmware/tx-easysolder-E77-E22-dual-wle5cc-xtal-v1.2.05-dev-arq-@b39c98bc.hex

Large diffs are not rendered by default.

5,218 changes: 5,218 additions & 0 deletions firmware/tx-easysolder-E77-E28-dualband-wle5cc-v1.2.05-dev-arq-@b39c98bc.hex

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file added firmware/[email protected]
Binary file not shown.
34 changes: 30 additions & 4 deletions mLRS/Common/arq.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once

#define USE_ARQ // just for the moment, eventually should go
//#define USE_ARQ_DBG
#define USE_ARQ_DBG
#define USE_ARQ_RETRY_CNT -1 // -1: set by SetRetryCnt(), 0 = off, 255 = infinite,
#define USE_ARQ_TX_SIM_MISS 4 //9 // 0 = off
#define USE_ARQ_RX_SIM_MISS 3 //5 //5 // 0 = off
Expand Down Expand Up @@ -49,7 +49,7 @@ class tTransmitArq

void Disconnected(void);
void FrameMissed(void);
void Received(uint8_t ack_seq_no);
void AckReceived(uint8_t ack_seq_no);

bool GetFreshPayload(void);
uint8_t SeqNo(void);
Expand Down Expand Up @@ -94,7 +94,7 @@ void tTransmitArq::FrameMissed(void)
}


void tTransmitArq::Received(uint8_t ack_seq_no)
void tTransmitArq::AckReceived(uint8_t ack_seq_no)
{
received_ack_seq_no = ack_seq_no; // is 0/1
status = ARQ_TX_RECEIVED;
Expand Down Expand Up @@ -177,6 +177,9 @@ uint8_t tTransmitArq::SeqNo(void)

void tTransmitArq::SetRetryCnt(uint8_t retry_cnt)
{
//payload_retry_cnt = 0; return;
payload_retry_cnt = UINT8_MAX; return;

#ifndef USE_ARQ_DBG
payload_retry_cnt = retry_cnt;
#else
Expand Down Expand Up @@ -387,7 +390,7 @@ class tTransmitArq

void Disconnected(void) {}
void FrameMissed(void) {}
olliw42 marked this conversation as resolved.
Show resolved Hide resolved
void Received(uint8_t ack_seq_no) {}
void AckReceived(uint8_t ack_seq_no) {}

bool GetFreshPayload(void) { return true; }
uint8_t SeqNo(void) { seq_no++; return seq_no; }
Expand Down Expand Up @@ -416,3 +419,26 @@ class tReceiveArq
#endif

#endif // ARQ_H

/* some sort of documentation
for the Rx -> Tx transmission direction:

Tx Rx
rarq tarq

prepare_transmit_frame() prepare_transmit_frame()
ack = AckSeqNo() get_fresh_payload = GetFreshPayload()
seq_no = SeqNo()
SetRetryCntAuto()
process_received_frame()
accept_payload = AcceptPayload()

handle_receive() handle_receive()
Received() AckReceived()
or FrameMissed() or FrameMissed()
FrameLost() -> reset parsers

handle_receive_none() handle_receive_none()
FrameMissed() FrameMissed()

*/
4 changes: 3 additions & 1 deletion mLRS/Common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ tFhss fhss;

tBindBase bind;

#ifdef DEVICE_IS_TRANSMITTER
tBuzzer buzzer;
#endif
tFan fan;
tLEDs leds;

Expand Down Expand Up @@ -308,7 +310,7 @@ STATIC_ASSERT(sizeof(tRxCmdFrameRxSetupData) == FRAME_RX_PAYLOAD_LEN, "tRxCmdFra
STATIC_ASSERT(sizeof(tRxSetup) == 36, "tRxSetup len missmatch")
STATIC_ASSERT(sizeof(tTxSetup) == 20, "tTxSetup len missmatch")
STATIC_ASSERT(sizeof(tCommonSetup) == 16, "tCommonSetup len missmatch")
STATIC_ASSERT(sizeof(tSetup) == 22+16+36+(20+16)*SETUP_CONFIG_LEN+8+2, "tSetup len missmatch")
STATIC_ASSERT(sizeof(tSetup) == 22+16+36+(20+16)*SETUP_CONFIG_NUM+8+2, "tSetup len missmatch")

STATIC_ASSERT(sizeof(fhss_config) == sizeof(tFhssConfig) * FHSS_CONFIG_NUM, "fhss_config size missmatch")

Expand Down
2 changes: 0 additions & 2 deletions mLRS/Common/common_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@
#define SETUP_RX_OUT_RSSI_CHANNEL 0 // 0: off, 5: CH5, 16: CH16
#define SETUP_RX_OUT_LQ_CHANNEL 0 // 0: off, 5: CH5, 16: CH16

#define SETUP_RX_BUZZER 0 // 0: off, 1: LP


#define BIND_PHRASE "mlrs.0" // string of 6 characters, allowed are 'a'-'z','0'-'9','_','-','#','.'

Expand Down
1 change: 0 additions & 1 deletion mLRS/Common/common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ typedef enum {
TX_TASK_RESTART_CONTROLLER,
TX_TASK_FLASH_ESP,
TX_TASK_ESP_PASSTHROUGH,
TX_TASK_ESP_CLI,
TX_TASK_CLI_CHANGE_CONFIG_ID,
} TX_TASK_ENUM;

Expand Down
6 changes: 0 additions & 6 deletions mLRS/Common/fan.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ void tFan::SetPower(int8_t power_dbm)
}


//-------------------------------------------------------
// Low-level beep implementation
//-------------------------------------------------------



#endif // DEVICE_HAS_FAN

#endif // FAN_H
Expand Down
4 changes: 2 additions & 2 deletions mLRS/Common/frame_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ typedef struct
uint8_t SerialBaudrate : 4;
uint8_t SerialLinkMode : 4;
uint8_t SendRadioStatus : 4;
uint8_t Buzzer : 4;
uint8_t __Buzzer : 4; // deprecated
uint8_t SendRcChannels : 4;
uint8_t __RadioStatusMethod : 4; // deprecated
uint8_t OutLqChannelMode : 4;
Expand Down Expand Up @@ -248,7 +248,7 @@ typedef struct
int16_t Power_list[8];
uint8_t Diversity_allowed_mask;
uint8_t OutMode_allowed_mask;
uint8_t Buzzer_allowed_mask;
uint8_t __Buzzer_allowed_mask; // deprecated

uint8_t spare3[5];
}) tRxCmdFrameRxSetupData; // 82 bytes
Expand Down
48 changes: 44 additions & 4 deletions mLRS/Common/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,48 @@ typedef enum {
} CHECK_ENUM;


// update header info and rcdata with new data, keep payload
void update_txframe_stats_and_rcdata(tTxFrame* frame, tFrameStats* frame_stats, tRcData* rc)
{
uint16_t crc;

frame->sync_word = Config.FrameSyncWord;
// keep !! frame->status.seq_no = frame_stats->seq_no;
frame->status.ack = frame_stats->ack;
// keep !! frame->status.frame_type = type; // FRAME_TYPE_TX, FRAME_TYPE_TX_RX_CMD
frame->status.antenna = frame_stats->antenna;
frame->status.transmit_antenna = frame_stats->transmit_antenna;
frame->status.rssi_u7 = rssi_u7_from_i8(frame_stats->rssi);
frame->status.LQ_rc = frame_stats->LQ_rc;
frame->status.LQ_serial = frame_stats->LQ_serial;
// keep !! frame->status.payload_len = payload_len;

frame->rc1.ch0 = rc->ch[0]; // 0 .. 1024 .. 2047, 11 bits
frame->rc1.ch1 = rc->ch[1];
frame->rc1.ch2 = rc->ch[2];
frame->rc1.ch3 = rc->ch[3];
frame->rc2.ch4 = rc->ch[4]; // 0 .. 1024 .. 2047, 11 bits
frame->rc2.ch5 = rc->ch[5];
frame->rc2.ch6 = rc->ch[6];
frame->rc2.ch7 = rc->ch[7];
frame->rc2.ch8 = rc->ch[8] / 8; // 0 .. 128 .. 255, 8 bits
frame->rc2.ch9 = rc->ch[9] / 8;
frame->rc2.ch10 = rc->ch[10] / 8;
frame->rc2.ch11 = rc->ch[11] / 8;
frame->rc1.ch12 = (rc->ch[12] >= 1536) ? 2 : ((rc->ch[12] <= 512) ? 0 : 1); // 0 .. 1 .. 2, bits, 3-way
frame->rc1.ch13 = (rc->ch[13] >= 1536) ? 2 : ((rc->ch[13] <= 512) ? 0 : 1);
frame->rc2.ch14 = (rc->ch[14] >= 1536) ? 2 : ((rc->ch[14] <= 512) ? 0 : 1);
frame->rc2.ch15 = (rc->ch[15] >= 1536) ? 2 : ((rc->ch[15] <= 512) ? 0 : 1);

fmav_crc_init(&crc);
fmav_crc_accumulate_buf(&crc, (uint8_t*)frame, FRAME_TX_RX_HEADER_LEN + FRAME_TX_RCDATA1_LEN);
frame->crc1 = crc;

fmav_crc_accumulate_buf(&crc, (uint8_t*)frame + FRAME_TX_RX_HEADER_LEN + FRAME_TX_RCDATA1_LEN, FRAME_TX_RX_LEN - FRAME_TX_RX_HEADER_LEN - FRAME_TX_RCDATA1_LEN - 2);
frame->crc = crc;
}


void _pack_txframe_w_type(tTxFrame* frame, uint8_t type, tFrameStats* frame_stats, tRcData* rc, uint8_t* payload, uint8_t payload_len)
{
uint16_t crc;
Expand Down Expand Up @@ -251,7 +293,7 @@ void cmdframerxparameters_rxparams_from_rxsetup(tCmdFrameRxParameters* rx_params
rx_params->SerialBaudrate = Setup.Rx.SerialBaudrate;
rx_params->SerialLinkMode = Setup.Rx.SerialLinkMode;
rx_params->SendRadioStatus = Setup.Rx.SendRadioStatus;
rx_params->Buzzer = Setup.Rx.Buzzer;
// deprecated rx_params->Buzzer = Setup.Rx.Buzzer;
rx_params->SendRcChannels = Setup.Rx.SendRcChannels;
// deprecated rx_params->RadioStatusMethod = Setup.Rx.RadioStatusMethod;

Expand All @@ -277,7 +319,7 @@ void cmdframerxparameters_rxparams_to_rxsetup(tCmdFrameRxParameters* rx_params)
Setup.Rx.SerialBaudrate = rx_params->SerialBaudrate;
Setup.Rx.SerialLinkMode = rx_params->SerialLinkMode;
Setup.Rx.SendRadioStatus = rx_params->SendRadioStatus;
Setup.Rx.Buzzer = rx_params->Buzzer;
// deprecated Setup.Rx.Buzzer = rx_params->Buzzer;
Setup.Rx.SendRcChannels = rx_params->SendRcChannels;
// deprecated Setup.Rx.RadioStatusMethod = rx_params->RadioStatusMethod;

Expand Down Expand Up @@ -330,7 +372,6 @@ tRxCmdFrameRxSetupData* rx_setupdata = (tRxCmdFrameRxSetupData*)frame->payload;
power_optstr_from_power_list(SetupMetaData.Rx_Power_optstr, power_list, 8, 44);
SetupMetaData.Rx_Diversity_allowed_mask = rx_setupdata->Diversity_allowed_mask;
SetupMetaData.Rx_OutMode_allowed_mask = rx_setupdata->OutMode_allowed_mask;
SetupMetaData.Rx_Buzzer_allowed_mask = rx_setupdata->Buzzer_allowed_mask;
}


Expand Down Expand Up @@ -381,7 +422,6 @@ tRxCmdFrameRxSetupData rx_setupdata = {};
}
rx_setupdata.Diversity_allowed_mask = SetupMetaData.Rx_Diversity_allowed_mask;
rx_setupdata.OutMode_allowed_mask = SetupMetaData.Rx_OutMode_allowed_mask;
rx_setupdata.Buzzer_allowed_mask = SetupMetaData.Rx_Buzzer_allowed_mask;

_pack_rxframe_w_type(frame, FRAME_TYPE_TX_RX_CMD, frame_stats, (uint8_t*)&rx_setupdata, sizeof(rx_setupdata));
}
Expand Down
96 changes: 96 additions & 0 deletions mLRS/Common/hal/hal-power-pa.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
//*******************************************************
// Copyright (c) MLRS project
// GPL3
// https://www.gnu.org/licenses/gpl-3.0.de.html
// OlliW @ www.olliw.eu
//*******************************************************
// hal generic power settings for common PAs
// and other generic cases
//*******************************************************

//-------------------------------------------------------
//-- 2.4 GHz
//-------------------------------------------------------

#ifdef POWER_PA_NONE_SX128X

#define POWER_GAIN_DBM 0 // gain of a PA stage if present
#define POWER_SX1280_MAX_DBM SX1280_POWER_12p5_DBM // maximum allowed sx power
#define POWER_USE_DEFAULT_RFPOWER_CALC

#define RFPOWER_DEFAULT 2 // index into rfpower_list array

const rfpower_t rfpower_list[] = {
{ .dbm = POWER_MIN, .mW = INT8_MIN },
{ .dbm = POWER_0_DBM, .mW = 1 },
{ .dbm = POWER_10_DBM, .mW = 10 },
{ .dbm = POWER_12p5_DBM, .mW = 18 },
};

#endif


#if defined POWER_PA_SKY85321_11 || defined POWER_PA_E28_2G4M27SX // E28-2G4M27S/SX

#define POWER_GAIN_DBM 27 // gain of a PA stage if present
#define POWER_SX1280_MAX_DBM SX1280_POWER_0_DBM // maximum allowed sx power
#define POWER_USE_DEFAULT_RFPOWER_CALC

#define RFPOWER_DEFAULT 1 // index into rfpower_list array

const rfpower_t rfpower_list[] = {
{ .dbm = POWER_MIN, .mW = INT8_MIN },
{ .dbm = POWER_10_DBM, .mW = 10 },
{ .dbm = POWER_20_DBM, .mW = 100 },
{ .dbm = POWER_24_DBM, .mW = 250 },
{ .dbm = POWER_27_DBM, .mW = 500 },
};

#endif
#ifdef POWER2_PA_SKY85321_11

#define POWER2_GAIN_DBM 27 // gain of a PA stage if present
#define POWER2_SX1280_MAX_DBM SX1280_POWER_0_DBM // maximum allowed sx power

#endif


//-------------------------------------------------------
//-- 868/915 MHz
//-------------------------------------------------------

#ifdef POWER_PA_NONE_SX127X

#define POWER_GAIN_DBM 0 // gain of a PA stage if present
#define POWER_SX1276_MAX_DBM SX1276_OUTPUT_POWER_MAX // maximum allowed sx power
#define POWER_USE_DEFAULT_RFPOWER_CALC

#define RFPOWER_DEFAULT 1 // index into rfpower_list array

const rfpower_t rfpower_list[] = {
{ .dbm = POWER_0_DBM, .mW = 1 },
{ .dbm = POWER_10_DBM, .mW = 10 },
{ .dbm = POWER_17_DBM, .mW = 50 },
};

#endif


#ifdef POWER_PA_NONE_SX126X

#define POWER_GAIN_DBM 0 // gain of a PA stage if present
#define POWER_SX126X_MAX_DBM SX126X_POWER_MAX // maximum allowed sx power
#define POWER_USE_DEFAULT_RFPOWER_CALC

#define RFPOWER_DEFAULT 2 // index into rfpower_list array

const rfpower_t rfpower_list[] = {
{ .dbm = POWER_MIN, .mW = INT8_MIN },
{ .dbm = POWER_0_DBM, .mW = 1 },
{ .dbm = POWER_10_DBM, .mW = 10 },
{ .dbm = POWER_20_DBM, .mW = 100 },
{ .dbm = POWER_22_DBM, .mW = 158 },
};

#endif

1 change: 0 additions & 1 deletion mLRS/Common/hal/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ In rx-hal files:
#define DEVICE_HAS_SERIAL_OR_DEBUG // is selected by DEBUG_ENABLED define
#define DEVICE_HAS_NO_DEBUG // board has no Debug port
#define DEVICE_HAS_DEBUG_SWUART // implement Debug as software UART
#define DEVICE_HAS_BUZZER // board has a Buzzer
#define DEVICE_HAS_I2C_DAC // board has a DAC for power control on I2C
#define DEVICE_HAS_SYSTEMBOOT // board has a means to invoke the system bootloader on startup
#define DEVICE_HAS_SINGLE_LED // board has only one LED
Expand Down
21 changes: 3 additions & 18 deletions mLRS/Common/hal/stm32/rx-hal-E77-MBLKit-wle5cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// hal
//*******************************************************

//#define MLRS_FEATURE_E77_XTAL // must be defined high, not here, affects main !
//#define MLRS_FEATURE_E77_XTAL // must be defined high up, not here, affects main !

//-------------------------------------------------------
// RX EByte E77 MBL Kit, STM32WLE5CC
Expand Down Expand Up @@ -266,10 +266,6 @@ void led_red_on(void) { gpio_high(LED_RED); }
void led_red_toggle(void) { gpio_toggle(LED_RED); }


//-- Buzzer
// has none


//-- SystemBootLoader

#define BOOT_BUTTON IO_PA1
Expand All @@ -294,19 +290,8 @@ void systembootloader_init(void)

//-- POWER

#define POWER_GAIN_DBM 0 // gain of a PA stage if present
#define POWER_SX126X_MAX_DBM SX126X_POWER_MAX // maximum allowed sx power
#define POWER_USE_DEFAULT_RFPOWER_CALC

#define RFPOWER_DEFAULT 2 // index into rfpower_list array

const rfpower_t rfpower_list[] = {
{ .dbm = POWER_MIN, .mW = INT8_MIN },
{ .dbm = POWER_0_DBM, .mW = 1 },
{ .dbm = POWER_10_DBM, .mW = 10 },
{ .dbm = POWER_20_DBM, .mW = 100 },
{ .dbm = POWER_22_DBM, .mW = 158 },
};
#define POWER_PA_NONE_SX126X
#include "../hal-power-pa.h"


//-- TEST
Expand Down
13 changes: 0 additions & 13 deletions mLRS/Common/hal/stm32/rx-hal-FRM303-f072cb.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// T1, T2 (32b), T3, T14, T15, T16, T17, internal T6, T7

#define DEVICE_HAS_OUT
#define DEVICE_HAS_BUZZER
//#define DEVICE_HAS_DEBUG_SWUART
#define DEVICE_HAS_NO_DEBUG
#define DEVICE_HAS_SYSTEMBOOT
Expand Down Expand Up @@ -235,18 +234,6 @@ void led_red_on(void) { gpio_low(LED_RED); }
void led_red_toggle(void) { gpio_toggle(LED_RED); }


//-- Buzzer
// Buzzer is active high

#define BUZZER IO_PB11
#define BUZZER_IO_AF IO_AF_2
#define BUZZER_TIMx TIM2
#define BUZZER_IRQn TIM2_IRQn
#define BUZZER_IRQHandler TIM2_IRQHandler
#define BUZZER_TIM_CHANNEL LL_TIM_CHANNEL_CH4
//#define BUZZER_TIM_IRQ_PRIORITY 14


//-- SystemBootLoader
// go into boot if FIVEWAY is DOWN during power up
// FIVEWAY-DOWN becomes bind button later on
Expand Down
Loading