/trunk/hmc5843.c |
---|
277,11 → 277,11 |
scale_max = (scale * 110)/100; |
// check scale for all axes |
scale = (XMax - XMin)/40; |
if((scale > scale_max) && (scale < scale_min)) return 0; |
if((scale > scale_max) || (scale < scale_min)) return 0; |
scale = (YMax + YMin)/40; |
if((scale > scale_max) && (scale < scale_min)) return 0; |
if((scale > scale_max) || (scale < scale_min)) return 0; |
scale = (ZMax + ZMin)/40; |
if((scale > scale_max) && (scale < scale_min)) return 0; |
if((scale > scale_max) || (scale < scale_min)) return 0; |
return 1; |
} |
/trunk/main.c |
---|
78,6 → 78,7 |
#include "settings.h" |
#include "config.h" |
#include "main.h" |
#include "debug.h" |
u8 BoardRelease = 0; |
u32 TimerCheckError; |
388,15 → 389,17 |
// enable interrupts |
VIC_ITCmd(EXTIT3_ITLine, ENABLE); |
Debug_OK("START"); |
for (;;) // the endless main loop |
{ |
UART0_ProcessRxData(); // process request |
UART1_ProcessRxData(); // process request |
USB_ProcessRxData(); // process request |
//USB_ProcessRxData(); // process request |
UART0_TransmitTxData(); // send answer |
UART1_TransmitTxData(); // send answer |
UART2_TransmitTxData(); // send answer |
USB_TransmitTxData(); // send answer |
//USB_TransmitTxData(); // send answer |
SPI0_UpdateBuffer(); // handle new SPI Data |
// ---------------- Error Check Timing ---------------------------- |
if(CheckDelay(TimerCheckError)) |
/trunk/main.h |
---|
1,6 → 1,11 |
#ifndef _MAIN_H |
#define _MAIN_H |
//----------------------- |
//#define DEBUG 1 |
//----------------------- |
#define VERSION_MAJOR 0 |
#define VERSION_MINOR 21 |
#define VERSION_PATCH 0 |
/trunk/uart1.c |
---|
69,7 → 69,6 |
#include "timer1.h" |
#include "timer2.h" |
#include "analog.h" |
#include "main.h" |
#include "compass.h" |
#include "waypoints.h" |
#include "mkprotocol.h" |
739,6 → 738,15 |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'E', NC_ADDRESS, 1, (u8 *)&ErrorMSG, sizeof(ErrorMSG)); |
UART1_Request_ErrorMessage = FALSE; |
} |
#ifdef DEBUG // only include functions if DEBUG is defined |
if(SendDebugOutput && (UART1_tx_buffer.Locked == FALSE)) |
{ |
MKProtocol_CreateSerialFrame(&UART1_tx_buffer,'0', NC_ADDRESS, 1, (unsigned char *) &tDebug, sizeof(tDebug)); |
//SendOutData('0', FC_ADDRESS, 1, (unsigned char *) &tDebug, sizeof(tDebug)); |
SendDebugOutput = 0; |
} |
#endif |
UART1_Transmit(); // output pending bytes in tx buffer |
} |