From e706ed1efea0f8a841fe413620c01fae1170beb9 Mon Sep 17 00:00:00 2001
From: Michael Dryden <mdryden@chem.utoronto.ca>
Date: Wed, 4 Feb 2015 18:00:26 -0500
Subject: [PATCH] Cleanup

---
 DSTAT-temp/src/ads1255.c | 23 +++++------------------
 DSTAT-temp/src/main.c    |  2 --
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/DSTAT-temp/src/ads1255.c b/DSTAT-temp/src/ads1255.c
index 745271f..aea4c44 100644
--- a/DSTAT-temp/src/ads1255.c
+++ b/DSTAT-temp/src/ads1255.c
@@ -21,20 +21,11 @@ void ads1255_init_pins(void)
 	   arch_ioport_set_port_level(IOPORT_PORTE, PIN4_bm|PIN5_bm|PIN7_bm, PIN4_bm|PIN7_bm);
 	   arch_ioport_set_pin_dir(IOPORT_CREATE_PIN(PORTD,5), IOPORT_DIR_INPUT);
 	   arch_ioport_set_pin_sense_mode(IOPORT_CREATE_PIN(PORTD,5), IOPORT_SENSE_FALLING);
-	   
-// 		ioport_configure_port_pin(&PORTE, PIN4_bm, IOPORT_INIT_HIGH | IOPORT_DIR_OUTPUT);
-// 		ioport_configure_port_pin(&PORTE, PIN5_bm, IOPORT_INIT_LOW | IOPORT_DIR_OUTPUT);
-// 		ioport_configure_port_pin(&PORTE, PIN6_bm, IOPORT_DIR_INPUT);
-// 		ioport_configure_port_pin(&PORTE, PIN7_bm, IOPORT_INIT_HIGH | IOPORT_DIR_OUTPUT);
-	   //DRDY
-//	   ioport_configure_port_pin(&PORTE, PIN3_bm, IOPORT_DIR_INPUT | IOPORT_FALLING); v1 Board
-//		ioport_configure_port_pin(&PORTD, PIN5_bm, IOPORT_DIR_INPUT | IOPORT_FALLING);
    }
-   
 
- void ads1255_init_module(void){
+void ads1255_init_module(void){
 	usart_spi_init(&USARTE1);
-	usart_spi_setup_device(&USARTE1, &spi_device_conf, SPI_MODE_1, 1900000UL, 0);//
+	usart_spi_setup_device(&USARTE1, &spi_device_conf, SPI_MODE_1, 1900000UL, 0);
   }
    
 void ads1255_sync(void){
@@ -53,7 +44,6 @@ void ads1255_reg_read(uint8_t address){
 
 	usart_spi_select_device(&USARTE1, &spi_device_conf);
 	
-//	while (ioport_pin_is_high(IOPORT_CREATE_PIN(PORTD, 5)));
 	while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5)))
 	
 	usart_spi_write_packet(&USARTE1, &(command_buffer[0]), 2);
@@ -69,7 +59,7 @@ void ads1255_reg_read(uint8_t address){
 
 void ads1255_reset(){
 	usart_spi_select_device(&USARTE1, &spi_device_conf);
-//	while (ioport_pin_is_high(IOPORT_CREATE_PIN(PORTD, 5)));
+
 	while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5)));
 	usart_spi_transmit(&USARTE1, ADS_RESET);
 	
@@ -78,7 +68,6 @@ void ads1255_reset(){
 	printf("ADS1255: Waiting for calibration\n\r");
 	#endif
 	
-//	while (ioport_pin_is_high(IOPORT_CREATE_PIN(PORTD, 5)));
 	while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5)));
 	usart_spi_deselect_device(&USARTE1, &spi_device_conf);
 	
@@ -99,7 +88,7 @@ void ads1255_setup(uint8_t buff, uint8_t rate, uint8_t pga){
 	usart_spi_write_packet(&USARTE1, (uint8_t*)&command_buffer, 6);
 	usart_spi_transmit(&USARTE1, ADS_SYNC);
 	usart_spi_transmit(&USARTE1, ADS_SELFCAL);
-//	while (ioport_pin_is_high(IOPORT_CREATE_PIN(PORTD, 5)));
+
 	while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5)))
 		;
     usart_spi_deselect_device(&USARTE1, &spi_device_conf);
@@ -144,8 +133,7 @@ void ads1255_wakeup(void){
 void ads1255_rdatac(void){
 	usart_spi_select_device(&USARTE1, &spi_device_conf);
 	usart_spi_transmit(&USARTE1, ADS_RDATAC);
-	
-//	while (ioport_pin_is_high(IOPORT_CREATE_PIN(PORTD, 5)));
+
 	while (arch_ioport_get_pin_level(IOPORT_CREATE_PIN(PORTD, 5)))
 		;
 	usart_spi_deselect_device(&USARTE1, &spi_device_conf);
@@ -243,7 +231,6 @@ int32_t ads1255_read_fast24(void){
 	else
 		input_buffer.uint[3] = 0x0;
 	
-//	printf("%x %x %x\n\r", input_buffer.uint[2],input_buffer.uint[1], input_buffer.uint[0]);
 	cpu_irq_restore(flags);
 	return input_buffer.int32;
 }
\ No newline at end of file
diff --git a/DSTAT-temp/src/main.c b/DSTAT-temp/src/main.c
index 14c3156..fd11c7b 100644
--- a/DSTAT-temp/src/main.c
+++ b/DSTAT-temp/src/main.c
@@ -12,8 +12,6 @@ int16_t p1, p2, p3, p4;
 uint16_t u1, u2, u3, u4;
 uint8_t p5, o1, o2, o3;
 
-//uint16_t step_dac[50], step_seconds[50];
-
 //Internal function declarations
 int8_t command_handler(char command);
 
-- 
GitLab