|
|
@@ -4,8 +4,8 @@
|
|
|
#include "ti_msp_dl_config.h"
|
|
|
#include <stdint.h>
|
|
|
#include <stdio.h>
|
|
|
-#include <string.h>
|
|
|
-#include <ti/drivers/GPIO.h>
|
|
|
+
|
|
|
+
|
|
|
//adc peripheral
|
|
|
#include "src/peripherals/adc/adc.h"
|
|
|
#include "src/peripherals/adc/adc_interface.h"
|
|
|
@@ -105,7 +105,7 @@ void I2C_controller_INST_IRQHandler(void) {
|
|
|
// printf("Interrupt index for I2C controller Arbitration Lost!\n");
|
|
|
break;
|
|
|
case DL_I2C_IIDX_CONTROLLER_NACK:
|
|
|
- // printf("I2C NACK Received\n");
|
|
|
+ printf("I2C NACK Received\n");
|
|
|
if ((gI2C.status == I2C_STATUS_RX_STARTED) ||
|
|
|
(gI2C.status = I2C_STATUS_TX_STARTED)) {
|
|
|
gI2C.status = I2C_STATUS_ERROR;
|
|
|
@@ -152,21 +152,22 @@ void I2C_target_INST_IRQHandler(void) {
|
|
|
|
|
|
int main(void){
|
|
|
SYSCFG_DL_init();
|
|
|
- Battery_Init();
|
|
|
+ //Battery_Init();
|
|
|
// Reset_I2C_Bus();
|
|
|
NVIC_EnableIRQ(I2C_target_INST_INT_IRQN);
|
|
|
NVIC_EnableIRQ(I2C_controller_INST_INT_IRQN);
|
|
|
- printf("*******Scanning the peripherals********\n");
|
|
|
+ //fflush(stdout);
|
|
|
//I2C Scanning
|
|
|
- I2C_scanBus(I2C_controller_INST);
|
|
|
+ printf("Testing I2C\n");
|
|
|
+ //I2C_scanBus(I2C_controller_INST);
|
|
|
I2C_init(&gI2C);
|
|
|
|
|
|
while(1){
|
|
|
- if(mcuCommandPending){
|
|
|
+ /*if(mcuCommandPending){
|
|
|
mcu_i2c_handle(I2C_target_INST);
|
|
|
mcuCommandPending= false;
|
|
|
continue;
|
|
|
- }
|
|
|
+ }*/
|
|
|
// Looping through the ADC Channels
|
|
|
for (uint8_t slot_id = 0; slot_id < NUM_SLOTS; slot_id++) {
|
|
|
for (uint8_t adc_channel = 0; adc_channel < ADC_CHANNEL_NUM; adc_channel++) {
|