Changeset - 2ee6c8e67f32
[Not reviewed]
Include/burn.h
Show inline comments
 
@@ -27,3 +27,5 @@ void burn_queue(uint8_t burn_id, uint8_t
 
void burn_process(void);
 
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/config.h
Show inline comments
 
@@ -73,3 +73,5 @@
 
 
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/error.h
Show inline comments
 
@@ -6,7 +6,8 @@
 
// If adding errors, remember to define a message for each in error.c
 
enum error_number
 
{
 
	ERR_RS485_PARSE = 0,
 
	ERR_GPS_OFF = 0,
 
	ERR_GPS_CHECKSUM,
 
};
 
 
 
@@ -17,3 +18,5 @@ uint8_t error_occurred(void);
 
uint8_t error_count(void);
 
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/gps.h
Show inline comments
 
@@ -42,3 +42,5 @@ gps_data_t* gps_getdata(void);
 
uint8_t gps_ison(void);
 

	
 
#endif /* GPS_H_ */
 

	
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/pressure.h
Show inline comments
 
@@ -33,3 +33,4 @@ int32_t pressure_getpressure(void);
 
I2C_HandleTypeDef* pressure_get_i2c_handle(void);
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/adc.h
Show inline comments
 
@@ -8,3 +8,5 @@ uint8_t adc_get_vbatt(void);
 
 
 
#endif /* SYSTEM_ADC_H_ */
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/flash.h
Show inline comments
 
@@ -44,3 +44,5 @@ void flash_checksum(void);
 
 
 
#endif // flash_h
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/gpio.h
Show inline comments
 
@@ -20,3 +20,5 @@ void gpio_process_shutdown(void);
 
 
#endif
 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/stm32f0xx_hal_conf.h
Show inline comments
 
@@ -262,3 +262,5 @@
 
#endif
 
 
#endif /* __STM32F0xx_HAL_CONF_H */
 
 
 // vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/stm32f0xx_it.h
Show inline comments
 
@@ -12,3 +12,5 @@ void SysTick_Handler(void);
 
#endif
 
 
#endif /* __STM32F0xx_IT_H */
 
 
 // vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/sysclk.h
Show inline comments
 
@@ -4,3 +4,5 @@
 
void sysclock_init(void);
 
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/uart.h
Show inline comments
 
@@ -10,3 +10,5 @@ DMA_HandleTypeDef* uart_get_txdma_handle
 
DMA_HandleTypeDef* uart_get_rxdma_handle(void);
 
 
#endif 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Include/system/watchdog.h
Show inline comments
 
@@ -5,3 +5,5 @@ void watchdog_init(void);
 
void watchdog_feed(void);
 
 
#endif
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/error.c
Show inline comments
 
@@ -14,7 +14,9 @@ volatile uint8_t num_errors_asserted = 0
 
// Moderately detailed messages corresponding to each error enum
 
char *  error_message[] =
 
{
 
		"RS485 parse fail",
 
		"GPS off",
 
		"GPS checksum",
 
 
};
 
 
// Set the passed error flag
 
@@ -78,3 +80,5 @@ uint8_t error_count(void)
 
{
 
	return num_errors_asserted;
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/gps.c
Show inline comments
 
@@ -5,6 +5,7 @@
 
#include "stm32f0xx_hal.h"
 

	
 
#include "config.h"
 
#include "error.h"
 
#include "system/gpio.h"
 
#include "system/uart.h"
 
#include "gps.h"
 
@@ -13,6 +14,7 @@
 
volatile gps_data_t position;
 
uint8_t gpson = 0;
 

	
 

	
 
// Private methods
 
static void gps_ubx_checksum(uint8_t* data, uint8_t len, uint8_t* cka, uint8_t* ckb);
 
static uint8_t _gps_verify_checksum(uint8_t* data, uint8_t len);
 
@@ -24,7 +26,7 @@ void gps_update_data(void)
 
	// Error!
 
	if(!gpson)
 
	{
 
//		led_blink(5);
 
		error_assert(ERR_GPS_OFF);
 
		return;
 
	}
 

	
 
@@ -54,9 +56,10 @@ void gps_update_data(void)
 
    volatile HAL_StatusTypeDef res = HAL_UART_Receive(uart_gethandle(), buf, 100, 3000);
 

	
 
    // Check 60 bytes minus SYNC and CHECKSUM (4 bytes)
 
//    if( !_gps_verify_checksum(&buf[2], 96) )
 
//        led_blink(2);
 

	
 
    if( !_gps_verify_checksum(&buf[2], 96) )
 
    {
 
		error_assert(ERR_GPS_CHECKSUM);
 
    }
 

	
 
    //volatile uint32_t gpstime_ms = (buf[6+0] << 24) | (buf[6+1] << 16) | buf[6+2] << 8) | (buf[6+3]);
 

	
 
@@ -179,9 +182,6 @@ void gps_poweron(void)
 
//	HAL_Delay(100);
 
//
 
//
 

	
 

	
 

	
 
    // Begin DMA reception
 
    //HAL_UART_Receive_DMA(uart_gethandle(), nmeaBuffer, NMEABUFFER_SIZE);
 

	
Source/main.c
Show inline comments
 
@@ -43,15 +43,11 @@ int main(void)
 
  hal_init();
 
  sysclock_init();
 
  gpio_init();
 
 
  adc_init();
 
 
  afsk_init();
 
  si446x_init();
 
  si446x_init();
 
 
  gps_poweron();
 
 
  pressure_init();
 
 
  // Software timers
 
@@ -81,7 +77,9 @@ int main(void)
 
		  si446x_cw_off();
 
 
	  // High-frequency function calls
 
//	  watchdog_feed();
 
	  watchdog_feed();
 
  }
 
}
 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/pressure.c
Show inline comments
 
@@ -107,3 +107,5 @@ inline I2C_HandleTypeDef* pressure_get_i
 
	return &hi2c1;
 
}
 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/_sbrk.c
Show inline comments
 
@@ -20,3 +20,5 @@ heap_end += incr;
 

	
 
return (caddr_t)prev_heap_end;
 
}
 

	
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/adc.c
Show inline comments
 
@@ -95,3 +95,5 @@ DMA_HandleTypeDef* adc__hdma_gethandle(v
 
{
 
	return &hdma_adc;
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/flash.c
Show inline comments
 
@@ -230,3 +230,5 @@ void flash_erase(void)
 
}
 
*/
 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/gpio.c
Show inline comments
 
@@ -59,3 +59,6 @@ void gpio_init(void)
 
  // Toggle the power LED
 
  HAL_GPIO_TogglePin(LED_POWER);
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
 
Source/system/interrupts.c
Show inline comments
 
@@ -44,3 +44,5 @@ void DMA1_Channel1_IRQHandler(void)
 
{
 
  HAL_DMA_IRQHandler(adc__hdma_gethandle());
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/sysclk.c
Show inline comments
 
@@ -82,3 +82,5 @@ void sysclock_init(void)
 
	  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
 
Source/system/uart.c
Show inline comments
 
@@ -117,3 +117,5 @@ DMA_HandleTypeDef* uart_get_rxdma_handle
 
    return &hdma_usart1_rx;
 
}
 
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
Source/system/watchdog.c
Show inline comments
 
@@ -31,3 +31,5 @@ void watchdog_feed(void)
 
	HAL_IWDG_Refresh(&hiwdg);
 
#endif
 
}
 
 
// vim:softtabstop=4 shiftwidth=4 expandtab
0 comments (0 inline, 0 general)