Skip to content

Commit

Permalink
Normalize line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
KamelHacene committed Jun 23, 2016
1 parent 64e6915 commit fe2cd84
Show file tree
Hide file tree
Showing 425 changed files with 194,413 additions and 194,361 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Auto detect text files not listed here for normalization
* text=auto

# Files that must be normalized to lf format
*.c text eol=lf
*.cpp text eol=lf
*.h text eol=lf
Expand All @@ -15,7 +17,15 @@
*.sh text eol=lf
*.t32 text eol=lf
*.cmm text eol=lf
*.md text eol=lf
*.txt text eol=lf
*.properties text eol=lf
*.html text eol=lf

# Files that must be normalized to crlf format
*.bat text eol=crlf

# Files that must stay untouched
*.a binary
*.bmp binary
*.elf binary
Expand All @@ -27,5 +37,7 @@
*.pdf binary
*.png binary
*.tiff binary
*.hex binary
*.rtf binary
*.xcuserstate binary

48 changes: 24 additions & 24 deletions examples/avr/arduinoMega2560/blink/blink.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even
}

// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even
}

184 changes: 92 additions & 92 deletions examples/avr/arduinoMega2560/extInterrupt/extInterrupt.cpp
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
#include "tpl_os.h"
#include "tpl_app_config.h"
#include <avr/io.h>


//This simple example uses one periodic task (periodicTask), activated by an alarm (periodicAl) and 2 external interrupts.
// -> The periodic task just blink the led (pin13)
// -< The 2 interrupts (rising edge) update the period of the alarm (slower/faster).

DeclareAlarm(periodicAl);

//the period of the alarm (non protected global var!)
unsigned int period = 1000;

//Note: The 'ISR' keyword is ALSO used by gcc to set interrupt handlers.
// Be careful to use either:
// * the one of 'tpl_os.h' (OSEK-ISR2) or
// * the one of 'avr/interrupt.h' (interrupt handler -> OSEK-ISR1)

//ATMega328p has 2 external interrupts on PD.2 (pin 2) and PD.3 (pin 3).
//other I/O can also be configure to have an interrupt on pin change.
//We use the pin 2 and 3 on Arduino Uno in this example.
//
// each time the button on pin2 is pressed (rising edge on pin2)
// The ISR is activated -> periodic task gets slower.
// the name of the ISR is the one defined in the .oil file.
ISR(ISRButtonSlow)
{
//slow alarm related to task periodicTask
period *= 1.1; //10% slower
CancelAlarm(periodicAl);
SetRelAlarm(periodicAl,period,period);
}

// each time the button on pin3 is pressed (rising edge on pin3)
// The ISR is activated -> periodic task gets faster
ISR(ISRButtonFast)
{
period *= 0.9; //10% faster
CancelAlarm(periodicAl);
SetRelAlarm(periodicAl,period,period);
}


//remove trampoline definition of ISR..
//#undef ISR
//and add GCC def of ISR :-/
//#include <avr/interrupt.h> //sei,cli
// => here, one could add ISR1 interrupts (i.e. fast interrupts
// that are not managed by the OS... but should not interact
// with it (no service call allowed!)

//be careful: the 'Arduino.h' header file includes 'avr/interrupt.h' and
//redefine the ISR macro!!!
#include "Arduino.h"
void setup(void)
{
// initialize digital pin 13 as an output.
init();
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.begin(115200);
Serial.print("Ceci est un test.\n");

//init button for ISRButtonSlow (PORTD.0 = pin 21)
DDRD &= ~(1<<0); // bit 0 (port D) is an input
PORTD |= (1<<0); // pullup port D.0
EICRA |= 0x03; // rising edge detection on D.0 (INT0)
EIMSK |= (1<<0); // config interrupt port D.0 => INT0

//init button for ISRButtonFast (PORTD.1 = pin 20)
DDRD &= ~(1<<1); // bit 1 (port D) is an input
PORTD |= (1<<1); // pullup port D.1
EICRA |= 0x07; // rising edge detection on D.1 (INT1)
EIMSK |= (1<<1); // config interrupt port D.1 => INT1

Serial.begin(115200);

StartOS(OSDEFAULTAPPMODE);
}

TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //impair
else digitalWrite(13, LOW); //pair

Serial.print("***** ");
Serial.print(nb);
Serial.println(" done");
}
#include "tpl_os.h"
#include "tpl_app_config.h"
#include <avr/io.h>


//This simple example uses one periodic task (periodicTask), activated by an alarm (periodicAl) and 2 external interrupts.
// -> The periodic task just blink the led (pin13)
// -< The 2 interrupts (rising edge) update the period of the alarm (slower/faster).

DeclareAlarm(periodicAl);

//the period of the alarm (non protected global var!)
unsigned int period = 1000;

//Note: The 'ISR' keyword is ALSO used by gcc to set interrupt handlers.
// Be careful to use either:
// * the one of 'tpl_os.h' (OSEK-ISR2) or
// * the one of 'avr/interrupt.h' (interrupt handler -> OSEK-ISR1)

//ATMega328p has 2 external interrupts on PD.2 (pin 2) and PD.3 (pin 3).
//other I/O can also be configure to have an interrupt on pin change.
//We use the pin 2 and 3 on Arduino Uno in this example.
//
// each time the button on pin2 is pressed (rising edge on pin2)
// The ISR is activated -> periodic task gets slower.
// the name of the ISR is the one defined in the .oil file.
ISR(ISRButtonSlow)
{
//slow alarm related to task periodicTask
period *= 1.1; //10% slower
CancelAlarm(periodicAl);
SetRelAlarm(periodicAl,period,period);
}

// each time the button on pin3 is pressed (rising edge on pin3)
// The ISR is activated -> periodic task gets faster
ISR(ISRButtonFast)
{
period *= 0.9; //10% faster
CancelAlarm(periodicAl);
SetRelAlarm(periodicAl,period,period);
}


//remove trampoline definition of ISR..
//#undef ISR
//and add GCC def of ISR :-/
//#include <avr/interrupt.h> //sei,cli
// => here, one could add ISR1 interrupts (i.e. fast interrupts
// that are not managed by the OS... but should not interact
// with it (no service call allowed!)

//be careful: the 'Arduino.h' header file includes 'avr/interrupt.h' and
//redefine the ISR macro!!!
#include "Arduino.h"
void setup(void)
{
// initialize digital pin 13 as an output.
init();
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Serial.begin(115200);
Serial.print("Ceci est un test.\n");

//init button for ISRButtonSlow (PORTD.0 = pin 21)
DDRD &= ~(1<<0); // bit 0 (port D) is an input
PORTD |= (1<<0); // pullup port D.0
EICRA |= 0x03; // rising edge detection on D.0 (INT0)
EIMSK |= (1<<0); // config interrupt port D.0 => INT0

//init button for ISRButtonFast (PORTD.1 = pin 20)
DDRD &= ~(1<<1); // bit 1 (port D) is an input
PORTD |= (1<<1); // pullup port D.1
EICRA |= 0x07; // rising edge detection on D.1 (INT1)
EIMSK |= (1<<1); // config interrupt port D.1 => INT1

Serial.begin(115200);

StartOS(OSDEFAULTAPPMODE);
}

TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //impair
else digitalWrite(13, LOW); //pair

Serial.print("***** ");
Serial.print(nb);
Serial.println(" done");
}
54 changes: 27 additions & 27 deletions examples/avr/arduinoMega2560/serial/serial.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
Serial.begin(115200); //115200 bps 8N1
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even

Serial.print(nb);
Serial.println(" done");
}
// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
Serial.begin(115200); //115200 bps 8N1
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even

Serial.print(nb);
Serial.println(" done");
}
48 changes: 24 additions & 24 deletions examples/avr/arduinoUno/blink/blink.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even
}

// see blink.oil head of file for information about the compilation process.

#include "tpl_os.h"
#include "Arduino.h"

void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

//The TASK is activated by the alarm "periodicAl":
//* The alarm "periodicAl" is configured in the .oil file to activate task
//"periodicTask" each 1000 pulses of counter SystemCounter.
//* The SystemCounter is the same as the systick used in Arduino, a tick each 1024us on a 16MHz arduino.
//* This task is periodic, with a period of 1024ms.
TASK(periodicTask)
{
static unsigned int nb = 0;
nb++;
if(nb & 1) digitalWrite(13, HIGH); //odd
else digitalWrite(13, LOW); //even
}

Loading

0 comments on commit fe2cd84

Please sign in to comment.