1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Mapping correct ports

This commit is contained in:
Sambas 2012-03-13 20:42:37 +02:00
parent be6a4f2a1b
commit ef7758505a
3 changed files with 33 additions and 33 deletions

View File

@ -2633,13 +2633,13 @@ void calcHomeArrow(void)
char temp[50]={0};
sprintf(temp,"hea:%d",(int)brng);
write_string(temp, 130, 10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 130, 5, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"ele:%d",(int)elevation);
write_string(temp, 130, 10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 130, 5+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"dis:%d",(int)d);
write_string(temp, 130, 10+10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 130, 5+10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"u2g:%d",(int)u2g);
write_string(temp, 130, 10+10+10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 130, 5+10+10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"%c%c",(int)(u2g/22.5f)*2+0x90,(int)(u2g/22.5f)*2+0x91);
write_string(temp,200,10+10+10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 3);
@ -2712,11 +2712,11 @@ void updateGraphics() {
char temp[50]={0};
memset(temp, ' ', 40);
sprintf(temp,"Lat:%d",(int)m_gpsLat);
write_string(temp, 5, 10, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 5, 5, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"Lon:%d",(int)m_gpsLon);
write_string(temp, 5, 10+14, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 5, 15, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
sprintf(temp,"Fix:%d",(int)m_gpsStatus);
write_string(temp, 5, 10+14+14, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
write_string(temp, 5, 25, 0, 0, TEXT_VA_TOP, TEXT_HA_LEFT, 0, 2);
/* Print RTC time */
@ -2727,27 +2727,27 @@ void updateGraphics() {
/* Print Number of detected video Lines */
sprintf(temp,"Lines:%4d",PIOS_Video_GetOSDLines());
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),10, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),5, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Print ADC voltage */
sprintf(temp,"Rssi:%4dV",(int)(PIOS_ADC_PinGet(5)*300*61/4096));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),20, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
sprintf(temp,"Rssi:%4dV",(int)(PIOS_ADC_PinGet(4)*3000/4096));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),15, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Print CPU temperature */
sprintf(temp,"Temp:%4dC",(int)(PIOS_ADC_PinGet(6)*0.29296875f-279));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),30, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),25, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Print ADC voltage FLIGHT*/
sprintf(temp,"FltV:%4dV",(int)(PIOS_ADC_PinGet(2)*300*61/4096));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),40, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),35, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Print ADC voltage VIDEO*/
sprintf(temp,"VidV:%4dV",(int)(PIOS_ADC_PinGet(3)*300*61/4096));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),50, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),45, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Print ADC voltage RSSI */
sprintf(temp,"Rssi:%4dV",(int)(PIOS_ADC_PinGet(4)*300*61/4096));
write_string(temp, (GRAPHICS_WIDTH_REAL - 2),60, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
//sprintf(temp,"Curr:%4dA",(int)(PIOS_ADC_PinGet(0)*300*61/4096));
//write_string(temp, (GRAPHICS_WIDTH_REAL - 2),60, 0, 0, TEXT_VA_TOP, TEXT_HA_RIGHT, 0, 2);
/* Draw Battery Gauge */
m_batt++;
@ -2799,7 +2799,7 @@ void updateGraphics() {
}
//write_filled_rectangle(draw_buffer_level,20,20,30,30,1);
//write_filled_rectangle(draw_buffer_mask,30,30,30,30,1);
lamas();
//lamas();
/* Make sure every line last bit is 0 */
write_vline( draw_buffer_level,GRAPHICS_WIDTH_REAL-1,0,GRAPHICS_HEIGHT_REAL-1,0);
write_vline( draw_buffer_mask,GRAPHICS_WIDTH_REAL-1,0,GRAPHICS_HEIGHT_REAL-1,0);

View File

@ -580,7 +580,7 @@ void PIOS_Board_Init(void) {
pios_com_telem_rf_id = 0;
#endif /* PIOS_INCLUDE_COM_TELEM */
#if defined(PIOS_INCLUDE_COM_TELEM)
#if defined(PIOS_INCLUDE_COM_COTELEM)
{ /* Eventually add switch for this port function */
uint32_t pios_usart_cotelem_id;
if (PIOS_USART_Init(&pios_usart_cotelem_id, &pios_usart_cotelem_main_cfg)) {

View File

@ -120,8 +120,8 @@ static const struct pios_usart_cfg pios_usart_gps_cfg = {
* AUX USART
*/
static const struct pios_usart_cfg pios_usart_aux_cfg = {
.regs = USART1,
.remap = GPIO_AF_USART1,
.regs = USART2,
.remap = GPIO_AF_USART2,
.init = {
.USART_BaudRate = 230400,
.USART_WordLength = USART_WordLength_8b,
@ -133,7 +133,7 @@ static const struct pios_usart_cfg pios_usart_aux_cfg = {
},
.irq = {
.init = {
.NVIC_IRQChannel = USART1_IRQn,
.NVIC_IRQChannel = USART2_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
@ -142,7 +142,7 @@ static const struct pios_usart_cfg pios_usart_aux_cfg = {
.rx = {
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_10,
.GPIO_Pin = GPIO_Pin_3,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
@ -152,7 +152,7 @@ static const struct pios_usart_cfg pios_usart_aux_cfg = {
.tx = {
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_9,
.GPIO_Pin = GPIO_Pin_2,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
@ -168,8 +168,8 @@ static const struct pios_usart_cfg pios_usart_aux_cfg = {
* Telemetry on main USART
*/
static const struct pios_usart_cfg pios_usart_telem_main_cfg = {
.regs = USART6,
.remap = GPIO_AF_USART6,
.regs = UART4,
.remap = GPIO_AF_UART4,
.init = {
.USART_BaudRate = 57600,
.USART_WordLength = USART_WordLength_8b,
@ -181,16 +181,16 @@ static const struct pios_usart_cfg pios_usart_telem_main_cfg = {
},
.irq = {
.init = {
.NVIC_IRQChannel = USART6_IRQn,
.NVIC_IRQChannel = UART4_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = GPIOC,
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_7,
.GPIO_Pin = GPIO_Pin_1,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
@ -198,9 +198,9 @@ static const struct pios_usart_cfg pios_usart_telem_main_cfg = {
},
},
.tx = {
.gpio = GPIOC,
.gpio = GPIOA,
.init = {
.GPIO_Pin = GPIO_Pin_6,
.GPIO_Pin = GPIO_Pin_0,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
@ -212,7 +212,7 @@ static const struct pios_usart_cfg pios_usart_telem_main_cfg = {
#endif /* PIOS_COM_TELEM */
#if 1
#if 0
/*
* COTelemetry on main USART
*/
@ -307,7 +307,7 @@ static const struct pios_usb_cfg pios_usb_main_cfg = {
.init = {
.NVIC_IRQChannel = OTG_FS_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW,
.NVIC_IRQChannelSubPriority = 3,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
@ -646,11 +646,11 @@ void DMA2_Stream5_IRQHandler(void) __attribute__ ((alias("PIOS_VIDEO_DMA_Handler
void PIOS_VIDEO_DMA_Handler(void)
{
if (DMA_GetFlagStatus(DMA1_Stream7,DMA_FLAG_TCIF7)) { // whole double buffer filled
DMA_ClearFlag(DMA1_Stream5,DMA_FLAG_TCIF7);
DMA_ClearFlag(DMA1_Stream7,DMA_FLAG_TCIF7);
//PIOS_LED_Toggle(LED2);
}
else if (DMA_GetFlagStatus(DMA1_Stream7,DMA_FLAG_HTIF7)) {
DMA_ClearFlag(DMA1_Stream5,DMA_FLAG_HTIF7);
DMA_ClearFlag(DMA1_Stream7,DMA_FLAG_HTIF7);
}
else {