Changeset - 145ff3003e1e
[Not reviewed]
default
0 1 0
Ethan Zonca - 8 years ago 2017-10-14 13:36:10
ez@ethanzonca.com
Fixed extended stuff! Changed ID to hopefully unused one. Power is still superlow.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/wspr.c
Show inline comments
 
@@ -84,49 +84,49 @@ void wspr_transmit(uint8_t* grid_locator
 
        uint32_t subalt = (1068 * maiden_ext) + (gps_getdata()->altitude / 20);
 

	
 

	
 

	
 
        ////////////////////////////////////////////
 
        // 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
 

	
 
        // Mask off following 3 26valmax fields
 
        uint32_t chunk = subalt / 26 / 26 / 26; 
 

	
 
        // Encode to callsign
 
        if(chunk < 10)
 
            call[1] = '0' + chunk;
 
        else
 
            call[1] = chunk - 10 + 'A';
 

	
 

	
 
        // Static set ID
 
        call[2] = '4'; // balloon ID #4
 
        call[2] = '3'; // balloon ID #4
 

	
 
        // Subtract off previous portion
 
        subalt -= (chunk * 26 * 26 * 26);
 

	
 
        // Mask off following 2 26bit values
 
        chunk = (subalt / 26 / 26);
 

	
 
        call[3] = 'A' + chunk;
 

	
 
        // Subtract off previous portion
 
        subalt -= (chunk * 26 * 26);
 

	
 
        // Mask off following 1 26bit values
 
        chunk = (subalt / 26);
 

	
 
        call[4] = 'A' + chunk;
 

	
 
        // Subtract off previous portion
 
        subalt -= (chunk * 26);
 

	
 
        // Remainder is the last call char
 
        call[5] = 'A' + subalt;
 
 
 

	
 
@@ -177,49 +177,49 @@ void wspr_transmit(uint8_t* grid_locator
 
        engdata -= (chunk * 18 * 10 * 10 * 19);  
 

	
 
        // Mask of fields
 
        chunk = engdata / 10 / 10 / 19;  
 

	
 
        // Encode to grid locator
 
        loc[1] = 'A' + chunk;
 

	
 
        // Subtract off previous portion
 
        engdata -= (chunk * 10 * 10 * 19);  
 

	
 
        // Mask off fields
 
        chunk = engdata / 10 / 19;  
 

	
 
        // Encode
 
        loc[2] = '0' + chunk;
 

	
 
        // Subtract
 
        engdata -= (chunk * 10 * 19);  
 

	
 
        // Mask off
 
        chunk = engdata / 19;  
 

	
 
        // Encode
 
        loc[3] = chunk;
 
        loc[3] = '0' + chunk;
 

	
 
        // Subtract
 
        engdata -= (chunk * 19);  
 

	
 
        // Mask off
 
        chunk = engdata;  
 

	
 
        // Encode
 
        uint8_t powers[] = {0, 3, 7, 10, 13, 17, 20, 23, 27, 30, 33, 37, 40, 43, 47, 50, 53, 57, 60};
 
        dbm = powers[chunk];
 

	
 

	
 
    }
 
    else
 
    {
 
        call[0] = call_orig[0];
 
        call[1] = call_orig[1];
 
        call[2] = call_orig[2];
 
        call[3] = call_orig[3];
 
        call[4] = call_orig[4];
 
        call[5] = call_orig[5];
 
        call[6] = call_orig[6];
 

	
 
        dbm = DBM_ORIG; 
0 comments (0 inline, 0 general)