diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -70,7 +70,7 @@ int main(void) { // Every 10 minutes, wake up and try to wspr - if(state == SYSTEM_IDLE && (HAL_GetTick() - last_wspr_tx_time > 60000 /* * 10 */)) + if(state == SYSTEM_IDLE && (HAL_GetTick() - last_wspr_tx_time > 60000 * 10)) { state = SYSTEM_GPSACQ; } @@ -193,7 +193,7 @@ int main(void) // TODO: Switch between alternate and standard packet wspr_transmit(grid_locator, packet_type); - //packet_type = !packet_type; // alternate packet type + packet_type = !packet_type; // alternate packet type last_wspr_tx_time = HAL_GetTick(); state = SYSTEM_IDLE; } diff --git a/src/wspr.c b/src/wspr.c --- a/src/wspr.c +++ b/src/wspr.c @@ -18,7 +18,7 @@ char call_orig[7] = "KD8TDF"; // Test stuff char call[7] = "KD8TDF"; -char loc[5] = "EN82"; +char loc[7] = "EN82"; uint8_t dbm = 10; uint8_t tx_buffer[255]; @@ -69,9 +69,6 @@ void wspr_transmit(uint8_t* grid_locator // If alternate packet, send 0XFXXEN82XX if(send_alternate) { - - - ///////////////////////////////////////////////// // Composite altitude and sub-maidenhead locator ///////////////////////////////////////////////// @@ -90,6 +87,8 @@ void wspr_transmit(uint8_t* grid_locator //////////////////////////////////////////// // Encode extended maidenhead and altitude //////////////////////////////////////////// + + // Static set first char: balloon ID (invalid call) call[0] = '0'; // Split into chunks of valmax 36, 26, 26, 26 @@ -103,6 +102,10 @@ void wspr_transmit(uint8_t* grid_locator else call[1] = chunk - 10 + 'A'; + + // Static set ID + call[2] = '4'; // balloon ID #4 + // Subtract off previous portion subalt -= (chunk * 26 * 26 * 26); @@ -160,7 +163,7 @@ void wspr_transmit(uint8_t* grid_locator chunk = engdata / 18 / 10 / 10 / 19; // Encode to grid locator - grid_locator[0] = 'A' + chunk; + loc[0] = 'A' + chunk; // Subtract off previous portion engdata -= (chunk * 18 * 10 * 10 * 19); @@ -169,7 +172,7 @@ void wspr_transmit(uint8_t* grid_locator chunk = engdata / 10 / 10 / 19; // Encode to grid locator - grid_locator[1] = 'A' + chunk; + loc[1] = 'A' + chunk; // Subtract off previous portion engdata -= (chunk * 10 * 10 * 19); @@ -178,7 +181,7 @@ void wspr_transmit(uint8_t* grid_locator chunk = engdata / 10 / 19; // Encode - grid_locator[2] = '0' + chunk; + loc[2] = '0' + chunk; // Subtract engdata -= (chunk * 10 * 19); @@ -187,7 +190,7 @@ void wspr_transmit(uint8_t* grid_locator chunk = engdata / 19; // Encode - grid_locator[3] = chunk; + loc[3] = chunk; // Subtract engdata -= (chunk * 19);