Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ MCU = atmega328p
F_CPU = 8000000
BAUD = 9600
PROGRAMMER_TYPE = avrispmkII
PROGRAMMER_ARGS =
# PROGRAMMER_TYPE = atmelice_isp
PROGRAMMER_ARGS = -B 125kHz

# Supported RFM radio module variants: 69 and 95
RFM = 95
Expand Down
8 changes: 5 additions & 3 deletions avrrfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static void receiveTemp(void) {
rfmLoRaRxRead(payload, sizeof (payload));
Temperature temp = readTemp(payload);

rfmSetOutputPower(temp.power);
uint8_t response[] = {flags.rssi};
rfmLoRaTx(response, sizeof (response));

Expand All @@ -285,6 +286,7 @@ static void receiveTemp(void) {
rfmReadPayload(payload, sizeof (payload));
Temperature temp = readTemp(payload);

rfmSetOutputPower(temp.power);
uint8_t response[] = {flags.rssi};
rfmTransmitPayload(response, sizeof (response), NODE2);

Expand Down Expand Up @@ -349,9 +351,6 @@ int main(void) {
initWatchdog();
}

// enable global interrupts
sei();

printString("Hello Radio!\r\n");

uint8_t node = RECEIVER ? NODE1 : NODE2;
Expand All @@ -374,6 +373,9 @@ int main(void) {
}
}

// enable global interrupts
sei();

while (true) {
if (radio) {
if (!RECEIVER) {
Expand Down