Changeset - e3feb70c71e6
[Not reviewed]
default
0 2 0
Ethan Zonca - 10 years ago 2016-03-31 22:25:29
ez@ethanzonca.com
Commented out GPS code that wasn't compiling, added power saving options to si5351 code. Tx is now 66mA, no GPS.
2 files changed with 14 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/gps.c
Show inline comments
 
@@ -33,19 +33,19 @@ int numBytes = 0;
 
char tramsmissionType[7];
 

	
 

	
 
void gps_poweron(void)
 
{
 
    // NOTE: pchannel
 
    gpio_clear(GPS_ONOFF);
 
    //gpio_clear(GPS_ONOFF);
 
}
 

	
 
void gps_poweroff(void)
 
{
 
    // NOTE: pchannel
 
    gpio_set(GPS_ONOFF);
 
    //gpio_set(GPS_ONOFF);
 
}
 

	
 
char timestamp[12];	//hhmmss.ss
 
char* get_timestamp() 
 
{
 
	return timestamp;
 
@@ -169,13 +169,13 @@ enum decodeState {
 
	
 
}decodeState;
 

	
 

	
 
void usart1_isr(void)
 
{
 
	uint8_t recv = usart_recv(GPS_USART);
 
	uint8_t recv = 0;// usart_recv(GPS_USART);
 
	//ECHO debug: usart_send_blocking(GPS_USART, recv);
 
	nmeaBuffer[nmeaBufferDataPosition % NMEABUFFER_SIZE] = recv;
 
	nmeaBufferDataPosition = (nmeaBufferDataPosition + 1) % NMEABUFFER_SIZE;
 
}
 

	
 
void gps_init() 
 
@@ -211,13 +211,13 @@ void gps_init()
 

	
 
void gps_sendubx(uint8_t* dat, uint8_t size)
 
{
 
    uint8_t sendctr;
 
    for(sendctr = 0; sendctr < size; sendctr++)
 
    {
 
        usart_send(GPS_USART, dat[sendctr]);
 
        //usart_send(GPS_USART, dat[sendctr]);
 
    }
 
}
 

	
 
// Could inline if program space available
 
static void setParserState(uint8_t state)
 
{
src/main.c
Show inline comments
 
@@ -48,12 +48,21 @@ void encode_wspr(void)
 
    //si5351_set_ms_source(SI5351_CLK0, SI5351_PLLA);
 
    si5351_set_freq(WSPR_DEFAULT_FREQ * 100, 0, SI5351_CLK0);
 
    si5351_drive_strength(SI5351_CLK0, SI5351_DRIVE_8MA); // Set for max power if desired (8ma max)
 
    si5351_output_enable(SI5351_CLK0, 1);
 
    //si5351_pll_reset(SI5351_PLLA);
 
 
    // Make sure the other outputs of the SI5351 are disabled
 
    si5351_output_enable(SI5351_CLK1, 0); // Disable the clock initially
 
    si5351_output_enable(SI5351_CLK2, 0); // Disable the clock initially
 
 
    // disable clock powers
 
    si5351_set_clock_pwr(SI5351_CLK1, 0);
 
    si5351_set_clock_pwr(SI5351_CLK2, 0);
 
 
 
    // Encode message to transmit
 
    wspr_encode(call, loc, dbm, tx_buffer);
 
 
    // Key transmitter
 
    si5351_output_enable(SI5351_CLK0, 1);
 
 
@@ -85,13 +94,13 @@ int main(void)
 
 
    sysclk_init();
 
    gpio_init();
 
    dma_init();
 
    adc_init();
 
    i2c_init();
 
    gps_init();
 
//    gps_init();
 
 
    // Disable ICs
 
    HAL_GPIO_WritePin(OSC_NOTEN, 1);
 
    HAL_GPIO_WritePin(TCXO_EN, 0);
 
 
0 comments (0 inline, 0 general)