Subversion Repositories FlightCtrl

Rev

Rev 1964 | Rev 1975 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1964 Rev 1969
Line 66... Line 66...
66
#include "rc.h"
66
#include "rc.h"
67
#include "analog.h"
67
#include "analog.h"
68
#include "configuration.h"
68
#include "configuration.h"
69
#include "printf_P.h"
69
#include "printf_P.h"
70
#include "twimaster.h"
70
#include "twimaster.h"
-
 
71
#include "controlMixer.h"
71
#ifdef USE_NAVICTRL
72
#ifdef USE_NAVICTRL
72
#include "spi.h"
73
#include "spi.h"
73
#endif
74
#endif
74
#ifdef USE_MK3MAG
75
#ifdef USE_MK3MAG
75
#include "mk3mag.h"
76
#include "mk3mag.h"
Line 89... Line 90...
89
  // disable watchdog
90
  // disable watchdog
90
  MCUSR &= ~(1 << WDRF);
91
  MCUSR &= ~(1 << WDRF);
91
  WDTCSR |= (1 << WDCE) | (1 << WDE);
92
  WDTCSR |= (1 << WDCE) | (1 << WDE);
92
  WDTCSR = 0;
93
  WDTCSR = 0;
Line -... Line 94...
-
 
94
 
-
 
95
// This is strange: It should NOT be necessarty to do. But the call of the same,
-
 
96
// in channelMap_readOrDefault (if eeprom read fails) just sets all to 0,0,0,....
-
 
97
channelMap_default();
93
 
98
 
94
  // initalize modules
99
  // initalize modules
95
  output_init();
100
  output_init();
96
  timer0_init();
101
  timer0_init();
97
  timer2_init();
102
  timer2_init();
Line 105... Line 110...
105
#endif
110
#endif
106
#ifdef USE_MK3MAG
111
#ifdef USE_MK3MAG
107
  MK3MAG_Init();
112
  MK3MAG_Init();
108
#endif
113
#endif
Line -... Line 114...
-
 
114
 
-
 
115
  // Parameter Set handling
-
 
116
  channelMap_readOrDefault();
-
 
117
  mixerMatrix_readOrDefault();
-
 
118
  paramSet_readOrDefault();
109
 
119
 
110
  // enable interrupts global
120
  // enable interrupts global
Line 111... Line 121...
111
  sei();
121
  sei();
112
 
122
 
Line 117... Line 127...
117
  if (CPUType == ATMEGA644P)
127
  if (CPUType == ATMEGA644P)
118
    printf("p");
128
    printf("p");
119
  printf("\n\rSoftware: V%d.%d%c",VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH + 'a');
129
  printf("\n\rSoftware: V%d.%d%c",VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH + 'a');
120
  printf("\n\r===================================");
130
  printf("\n\r===================================");
Line 121... Line -...
121
 
-
 
122
  // Parameter Set handling
-
 
123
  channelMap_readOrDefault();
-
 
124
  mixerMatrix_readOrDefault();
-
 
125
  paramSet_readOrDefault();
-
 
126
 
131
 
127
  // Wait for a short time (otherwise the RC channel check won't work below)
132
  // Wait for a short time (otherwise the RC channel check won't work below)
128
  // timer = SetDelay(500);
133
  // timer = SetDelay(500);
Line 129... Line 134...
129
  // while(!CheckDelay(timer));
134
  // while(!CheckDelay(timer));