Changeset - 639ea4c6e941
[Not reviewed]
default
0 1 0
Ethan Zonca - 8 years ago 2017-09-24 16:58:46
ez@ethanzonca.com
Altitude seems to work correctly now!
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/wspr.c
Show inline comments
 
@@ -69,14 +69,15 @@ void wspr_transmit(uint8_t* grid_locator
 
    // If alternate packet, send 0XFXXEN82XX
 
    if(send_alternate)
 
    {
 
        /////////////////////////////////////////////////
 
        // Composite altitude and sub-maidenhead locator
 
        ///////////////////////////////////////////////// 
 
        uint16_t maiden_ext = (loc[4] - 'A') + ((loc[5] - 'A') * 24); // 0-575
 
        uint16_t altitude_mod = gps_getdata()->altitude / 20;   
 
        // Use untrimmed locator
 
        uint32_t maiden_ext = (grid_locator[4] - 'A') + ((grid_locator[5] - 'A') * 24); // 0-575
 
        uint32_t altitude_mod = gps_getdata()->altitude / 20;   
 

	
 
        // Ciel at 21,340 meters
 
        if(altitude_mod > 1067)
 
            altitude_mod = 1067; // Don't overflow into maidenhead!
 
    
 
        // Compose composite altitude (lsbs) with maidenhead locator (msbs)
 
@@ -228,12 +229,15 @@ void wspr_transmit(uint8_t* grid_locator
 
    HAL_TIM_Base_Init(&htim1);
 
    HAL_TIM_Base_Start_IT(&htim1);
 
    HAL_NVIC_SetPriority(TIM1_BRK_UP_TRG_COM_IRQn, 0, 0);
 
    HAL_NVIC_EnableIRQ(TIM1_BRK_UP_TRG_COM_IRQn);
 

	
 

	
 

	
 
    // TODO: Bring up TCXO sooner! Gotta let it warm up or something
 

	
 
    HAL_GPIO_WritePin(OSC_NOTEN, 0);
 
    HAL_GPIO_WritePin(TCXO_EN, 1);
 
    HAL_Delay(100);
 

	
 
    // Bring up the chip
 
    i2c_init();
0 comments (0 inline, 0 general)