Cleanup of files that didn't need to be changed in preparation for merge

This commit is contained in:
Josh Stewart 2017-08-31 14:53:46 +10:00
parent 976c18fb26
commit 2d0189c76d
4 changed files with 128 additions and 128 deletions

0
misra/check_misra.sh Normal file → Executable file
View File

View File

@ -1,15 +1,15 @@
Part/Designator,Manufacture Part Number
R3,RC0805FR-071KL
R5,RC0805FR-071KL
R4,RC0805JR-0710KL
R6,RC0805JR-0710KL
R7,RC0805JR-0710KL
R9,RC0805JR-0710KL
R11,RC0805JR-0710KL
R13,RC0805JR-0710KL
MAX9926,MAX9926UAEE+T
C2,CC0805KRX7R9BB103
C3,CC0805KKX7R7BB105
C4,CC0805KRX7R9BB102
C5,CC0805KRX7R9BB102
Part/Designator,Manufacture Part Number
R3,RC0805FR-071KL
R5,RC0805FR-071KL
R4,RC0805JR-0710KL
R6,RC0805JR-0710KL
R7,RC0805JR-0710KL
R9,RC0805JR-0710KL
R11,RC0805JR-0710KL
R13,RC0805JR-0710KL
MAX9926,MAX9926UAEE+T
C2,CC0805KRX7R9BB103
C3,CC0805KKX7R7BB105
C4,CC0805KRX7R9BB102
C5,CC0805KRX7R9BB102
C1,CC0805ZRY5V9BB104
1 Part/Designator Manufacture Part Number
2 R3 RC0805FR-071KL
3 R5 RC0805FR-071KL
4 R4 RC0805JR-0710KL
5 R6 RC0805JR-0710KL
6 R7 RC0805JR-0710KL
7 R9 RC0805JR-0710KL
8 R11 RC0805JR-0710KL
9 R13 RC0805JR-0710KL
10 MAX9926 MAX9926UAEE+T
11 C2 CC0805KRX7R9BB103
12 C3 CC0805KKX7R7BB105
13 C4 CC0805KRX7R9BB102
14 C5 CC0805KRX7R9BB102
15 C1 CC0805ZRY5V9BB104

View File

@ -1,8 +1,8 @@
Part/Designator,Manufacture Part Number,Quantity
"R3,R5",RC0805FR-071KL,2
"R4,R6,R7,R9,R11,R13",RC0805JR-0710KL,6
MAX9926,MAX9926UAEE+T,1
C2,CC0805KRX7R9BB103,1
C3,CC0805KKX7R7BB105,1
"C4,C5",CC0805KRX7R9BB102,2
Part/Designator,Manufacture Part Number,Quantity
"R3,R5",RC0805FR-071KL,2
"R4,R6,R7,R9,R11,R13",RC0805JR-0710KL,6
MAX9926,MAX9926UAEE+T,1
C2,CC0805KRX7R9BB103,1
C3,CC0805KKX7R7BB105,1
"C4,C5",CC0805KRX7R9BB102,2
C1,CC0805ZRY5V9BB104,1
1 Part/Designator Manufacture Part Number Quantity
2 R3,R5 RC0805FR-071KL 2
3 R4,R6,R7,R9,R11,R13 RC0805JR-0710KL 6
4 MAX9926 MAX9926UAEE+T 1
5 C2 CC0805KRX7R9BB103 1
6 C3 CC0805KKX7R7BB105 1
7 C4,C5 CC0805KRX7R9BB102 2
8 C1 CC0805ZRY5V9BB104 1

View File

@ -1,107 +1,107 @@
#ifndef SENSORS_H
#define SENSORS_H
#include "Arduino.h"
// The following are alpha values for the ADC filters.
// Their values are from 0 to 255 with 0 being no filtering and 255 being maximum
#define ADCFILTER_TPS 128
#define ADCFILTER_CLT 180
#define ADCFILTER_IAT 180
#define ADCFILTER_O2 128
#define ADCFILTER_BAT 128
#define ADCFILTER_MAP 20 //This is only used on Instantaneous MAP readings and is intentionally very weak to allow for faster response
#define ADCFILTER_BARO 64
#define BARO_MIN 87
#define BARO_MAX 108
/*
#if defined(CORE_AVR)
#define ANALOG_ISR
#endif
*/
volatile byte flexCounter = 0;
volatile int AnChannel[15];
unsigned long MAPrunningValue; //Used for tracking either the total of all MAP readings in this cycle (Event average) or the lowest value detected in this cycle (event minimum)
unsigned int MAPcount; //Number of samples taken in the current MAP cycle
byte MAPcurRev; //Tracks which revolution we're sampling on
/*
* Simple low pass IIR filter macro for the analog inputs
* This is effectively implementing the smooth filter from http://playground.arduino.cc/Main/Smooth
* But removes the use of floats and uses 8 bits of fixed precision.
*/
#define ADC_FILTER(input, alpha, prior) (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8
void instanteneousMAPReading();
void readMAP();
void flexPulse();
#if defined(ANALOG_ISR)
//Analog ISR interrupt routine
/*
ISR(ADC_vect)
{
byte nChannel;
int result = ADCL | (ADCH << 8);
//ADCSRA = 0x6E; // ADC disabled by clearing bit 7(ADEN)
//BIT_CLEAR(ADCSRA, ADIE);
nChannel = ADMUX & 0x07;
#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
if (nChannel==7) { ADMUX = 0x40; }
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
if(ADCSRB & 0x08) { nChannel += 8; } //8 to 15
if(nChannel == 15)
{
ADMUX = 0x40; //channel 0
ADCSRB = 0x00; //clear MUX5 bit
}
else if (nChannel == 7) //channel 7
{
ADMUX = 0x40;
ADCSRB = 0x08; //Set MUX5 bit
}
#endif
else { ADMUX++; }
AnChannel[nChannel-1] = result;
//BIT_SET(ADCSRA, ADIE);
//ADCSRA = 0xEE; // ADC Interrupt Flag enabled
}
*/
ISR(ADC_vect)
{
byte nChannel = ADMUX & 0x07;
int result = ADCL | (ADCH << 8);
BIT_CLEAR(ADCSRA, ADEN); //Disable ADC for Changing Channel (see chapter 26.5 of datasheet)
#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
if (nChannel==7) { ADMUX = 0x40; }
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
if( (ADCSRB & 0x08) > 0) { nChannel += 8; } //8 to 15
if(nChannel == 15)
{
ADMUX = 0x40; //channel 0
ADCSRB = 0x00; //clear MUX5 bit
}
else if (nChannel == 7) //channel 7
{
ADMUX = 0x40;
ADCSRB = 0x08; //Set MUX5 bit
}
#endif
else { ADMUX++; }
AnChannel[nChannel] = result;
BIT_SET(ADCSRA, ADEN); //Enable ADC
}
#endif
#endif // SENSORS_H
#ifndef SENSORS_H
#define SENSORS_H
#include "Arduino.h"
// The following are alpha values for the ADC filters.
// Their values are from 0 to 255 with 0 being no filtering and 255 being maximum
#define ADCFILTER_TPS 128
#define ADCFILTER_CLT 180
#define ADCFILTER_IAT 180
#define ADCFILTER_O2 128
#define ADCFILTER_BAT 128
#define ADCFILTER_MAP 20 //This is only used on Instantaneous MAP readings and is intentionally very weak to allow for faster response
#define ADCFILTER_BARO 64
#define BARO_MIN 87
#define BARO_MAX 108
/*
#if defined(CORE_AVR)
#define ANALOG_ISR
#endif
*/
volatile byte flexCounter = 0;
volatile int AnChannel[15];
unsigned long MAPrunningValue; //Used for tracking either the total of all MAP readings in this cycle (Event average) or the lowest value detected in this cycle (event minimum)
unsigned int MAPcount; //Number of samples taken in the current MAP cycle
byte MAPcurRev; //Tracks which revolution we're sampling on
/*
* Simple low pass IIR filter macro for the analog inputs
* This is effectively implementing the smooth filter from http://playground.arduino.cc/Main/Smooth
* But removes the use of floats and uses 8 bits of fixed precision.
*/
#define ADC_FILTER(input, alpha, prior) (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8
void instanteneousMAPReading();
void readMAP();
void flexPulse();
#if defined(ANALOG_ISR)
//Analog ISR interrupt routine
/*
ISR(ADC_vect)
{
byte nChannel;
int result = ADCL | (ADCH << 8);
//ADCSRA = 0x6E; // ADC disabled by clearing bit 7(ADEN)
//BIT_CLEAR(ADCSRA, ADIE);
nChannel = ADMUX & 0x07;
#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
if (nChannel==7) { ADMUX = 0x40; }
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
if(ADCSRB & 0x08) { nChannel += 8; } //8 to 15
if(nChannel == 15)
{
ADMUX = 0x40; //channel 0
ADCSRB = 0x00; //clear MUX5 bit
}
else if (nChannel == 7) //channel 7
{
ADMUX = 0x40;
ADCSRB = 0x08; //Set MUX5 bit
}
#endif
else { ADMUX++; }
AnChannel[nChannel-1] = result;
//BIT_SET(ADCSRA, ADIE);
//ADCSRA = 0xEE; // ADC Interrupt Flag enabled
}
*/
ISR(ADC_vect)
{
byte nChannel = ADMUX & 0x07;
int result = ADCL | (ADCH << 8);
BIT_CLEAR(ADCSRA, ADEN); //Disable ADC for Changing Channel (see chapter 26.5 of datasheet)
#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
if (nChannel==7) { ADMUX = 0x40; }
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
if( (ADCSRB & 0x08) > 0) { nChannel += 8; } //8 to 15
if(nChannel == 15)
{
ADMUX = 0x40; //channel 0
ADCSRB = 0x00; //clear MUX5 bit
}
else if (nChannel == 7) //channel 7
{
ADMUX = 0x40;
ADCSRB = 0x08; //Set MUX5 bit
}
#endif
else { ADMUX++; }
AnChannel[nChannel] = result;
BIT_SET(ADCSRA, ADEN); //Enable ADC
}
#endif
#endif // SENSORS_H