Skip to content

Commit

Permalink
Added communication functions related to ecos
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-serra committed Dec 4, 2018
1 parent 131935b commit 9bb9e54
Show file tree
Hide file tree
Showing 91 changed files with 68,138 additions and 39,742 deletions.
933 changes: 663 additions & 270 deletions MyConfig.mc3

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions build/default/debug/coms.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/default/debug\coms.p1: coms.c mcc_generated_files/eusart.h coms.h \
globalvariables.h mcc_generated_files/adcc.h \
mcc_generated_files/memory.h
6 changes: 3 additions & 3 deletions build/default/debug/interruptions.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build/default/debug\interruptions.p1: interruptions.c \
mcc_generated_files/device_config.h \
mcc_generated_files/interrupt_manager.h \
mcc_generated_files/i2c1_driver.h mcc_generated_files/tmr3.h \
mcc_generated_files/tmr4.h mcc_generated_files/pwm6.h \
mcc_generated_files/tmr1.h mcc_generated_files/tmr2.h \
mcc_generated_files/tmr4.h mcc_generated_files/tmr1.h \
mcc_generated_files/pwm6.h mcc_generated_files/tmr2.h \
mcc_generated_files/ext_int.h mcc_generated_files/memory.h \
sleepWakeUp.h Set_clock_thresholds.h
mcc_generated_files/eusart.h stateModifiers.h
118 changes: 87 additions & 31 deletions build/default/debug/interruptions.i
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
void sensor_timer(int lum, int temp);
int get_luminosity (void);
void setLedLuminosity(int);
void getValuesFromPreviousSession();
# 1 "interruptions.c" 2

# 1 "./mcc_generated_files/pin_manager.h" 1
# 244 "./mcc_generated_files/pin_manager.h"
# 268 "./mcc_generated_files/pin_manager.h"
void PIN_MANAGER_Initialize (void);
# 256 "./mcc_generated_files/pin_manager.h"
# 280 "./mcc_generated_files/pin_manager.h"
void PIN_MANAGER_IOC(void);
# 2 "interruptions.c" 2

Expand Down Expand Up @@ -20955,26 +20956,30 @@ uint8_t ADCC_GetConversionStageStatus(void);
volatile int hrs = 0;
volatile int mins = 0;
volatile int secs = 0;
const int PMON = 3;
volatile int PMON = 3;
volatile int ALAF = 1;
volatile int alarm = 0;
volatile int control_alarm = 0;
const int TALA = 2;
volatile int TALA = 2;
adc_result_t adcResult = 0;
volatile int LumThreshold = 2;
volatile int TempThreshold = 25;
volatile int temperature = 0 ;
volatile int luminosity = 0;

volatile int s1_pressed = 0;
volatile int mode_s = -1;

const int max_hour = 24;
const int max_min = 60;
const int max_temp =50;
const int max_lum = 10;
const int max_lum = 4;


volatile int LED_to_blink;
volatile int blink = 0;

volatile int blink_ctr = 0;
# 3 "interruptions.c" 2

# 1 "./mcc_generated_files/mcc.h" 1
Expand Down Expand Up @@ -21426,13 +21431,6 @@ extern void (*TMR4_InterruptHandler)(void);
void TMR4_DefaultInterruptHandler(void);
# 57 "./mcc_generated_files/mcc.h" 2

# 1 "./mcc_generated_files/pwm6.h" 1
# 102 "./mcc_generated_files/pwm6.h"
void PWM6_Initialize(void);
# 129 "./mcc_generated_files/pwm6.h"
void PWM6_LoadDutyValue(uint16_t dutyValue);
# 58 "./mcc_generated_files/mcc.h" 2

# 1 "./mcc_generated_files/tmr1.h" 1
# 100 "./mcc_generated_files/tmr1.h"
void TMR1_Initialize(void);
Expand All @@ -21458,6 +21456,13 @@ void TMR1_ISR(void);
extern void (*TMR1_InterruptHandler)(void);
# 421 "./mcc_generated_files/tmr1.h"
void TMR1_DefaultInterruptHandler(void);
# 58 "./mcc_generated_files/mcc.h" 2

# 1 "./mcc_generated_files/pwm6.h" 1
# 102 "./mcc_generated_files/pwm6.h"
void PWM6_Initialize(void);
# 129 "./mcc_generated_files/pwm6.h"
void PWM6_LoadDutyValue(uint16_t dutyValue);
# 59 "./mcc_generated_files/mcc.h" 2

# 1 "./mcc_generated_files/tmr2.h" 1
Expand Down Expand Up @@ -21688,39 +21693,89 @@ void INT_DefaultInterruptHandler(void);
# 62 "./mcc_generated_files/mcc.h" 2

# 1 "./mcc_generated_files/memory.h" 1
# 118 "./mcc_generated_files/memory.h"
# 123 "./mcc_generated_files/memory.h"
uint16_t FLASH_ReadWord(uint16_t flashAddr);
# 147 "./mcc_generated_files/memory.h"
# 152 "./mcc_generated_files/memory.h"
void FLASH_WriteWord(uint16_t flashAddr, uint16_t *ramBuf, uint16_t word);
# 183 "./mcc_generated_files/memory.h"
# 188 "./mcc_generated_files/memory.h"
int8_t FLASH_WriteBlock(uint16_t writeAddr, uint16_t *flashWordArray);
# 208 "./mcc_generated_files/memory.h"
# 213 "./mcc_generated_files/memory.h"
void FLASH_EraseBlock(uint16_t startAddr);
# 241 "./mcc_generated_files/memory.h"
# 246 "./mcc_generated_files/memory.h"
void DATAEE_WriteByte(uint16_t bAdd, uint8_t bData);
# 267 "./mcc_generated_files/memory.h"
# 272 "./mcc_generated_files/memory.h"
uint8_t DATAEE_ReadByte(uint16_t bAdd);
# 63 "./mcc_generated_files/mcc.h" 2
# 78 "./mcc_generated_files/mcc.h"

# 1 "./mcc_generated_files/eusart.h" 1
# 76 "./mcc_generated_files/eusart.h"
typedef union {
struct {
unsigned perr : 1;
unsigned ferr : 1;
unsigned oerr : 1;
unsigned reserved : 5;
};
uint8_t status;
}eusart_status_t;




extern volatile uint8_t eusartTxBufferRemaining;
extern volatile uint8_t eusartRxCount;





void (*EUSART_TxDefaultInterruptHandler)(void);
void (*EUSART_RxDefaultInterruptHandler)(void);
# 119 "./mcc_generated_files/eusart.h"
void EUSART_Initialize(void);
# 172 "./mcc_generated_files/eusart.h"
uint8_t EUSART_is_tx_ready(void);
# 224 "./mcc_generated_files/eusart.h"
uint8_t EUSART_is_rx_ready(void);
# 271 "./mcc_generated_files/eusart.h"
_Bool EUSART_is_tx_done(void);
# 319 "./mcc_generated_files/eusart.h"
eusart_status_t EUSART_get_last_status(void);
# 339 "./mcc_generated_files/eusart.h"
uint8_t EUSART_Read(void);
# 359 "./mcc_generated_files/eusart.h"
void EUSART_Write(uint8_t txData);
# 380 "./mcc_generated_files/eusart.h"
void EUSART_Transmit_ISR(void);
# 401 "./mcc_generated_files/eusart.h"
void EUSART_Receive_ISR(void);
# 422 "./mcc_generated_files/eusart.h"
void EUSART_RxDataHandler(void);
# 440 "./mcc_generated_files/eusart.h"
void EUSART_SetFramingErrorHandler(void (* interruptHandler)(void));
# 458 "./mcc_generated_files/eusart.h"
void EUSART_SetOverrunErrorHandler(void (* interruptHandler)(void));
# 476 "./mcc_generated_files/eusart.h"
void EUSART_SetErrorHandler(void (* interruptHandler)(void));
# 496 "./mcc_generated_files/eusart.h"
void EUSART_SetTxInterruptHandler(void (* interruptHandler)(void));
# 516 "./mcc_generated_files/eusart.h"
void EUSART_SetRxInterruptHandler(void (* interruptHandler)(void));
# 64 "./mcc_generated_files/mcc.h" 2
# 79 "./mcc_generated_files/mcc.h"
void SYSTEM_Initialize(void);
# 91 "./mcc_generated_files/mcc.h"
# 92 "./mcc_generated_files/mcc.h"
void OSCILLATOR_Initialize(void);
# 104 "./mcc_generated_files/mcc.h"
# 105 "./mcc_generated_files/mcc.h"
void PMD_Initialize(void);
# 4 "interruptions.c" 2

# 1 "./sleepWakeUp.h" 1
# 20 "./sleepWakeUp.h"
void GoToSleep(void);
void WakeUp(void);
# 5 "interruptions.c" 2

# 1 "./Set_clock_thresholds.h" 1
# 14 "./Set_clock_thresholds.h"
# 1 "./stateModifiers.h" 1
# 14 "./stateModifiers.h"
void s2Pressed();
void s1Pressed();
void clearLeds(void);
# 6 "interruptions.c" 2
# 5 "interruptions.c" 2


void changeleds(void){
Expand Down Expand Up @@ -21749,6 +21804,7 @@ void s1PressedInterruptHandler(void){

if(alarm == 1){
alarm = 0;
PWM6_LoadDutyValue(0);
}else{
if(mode_s == -1){
clearLeds();
Expand Down Expand Up @@ -21779,7 +21835,7 @@ void LED_blink_function(void){
case 2: do { LATAbits.LATA4 = 0; } while(0); break;
case 3: do { LATAbits.LATA5 = 0; } while(0); break;
case 4: PWM6_LoadDutyValue(0); break;
case 5: do { LATAbits.LATA7 = 1; } while(0); break;
case 5: do { LATAbits.LATA7 = 0; } while(0); break;
}
blink=0;
}
Expand Down
Loading

0 comments on commit 9bb9e54

Please sign in to comment.