changeset 86:345a42f6151b

Catch up with change to new board
author Daniel O'Connor <darius@dons.net.au>
date Thu, 12 Mar 2015 23:22:35 +1030
parents 18b154c447bb
children e30fe4bb8011
files 1wire-config.h hw.c tempctrl.c
diffstat 3 files changed, 27 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/1wire-config.h	Thu Mar 12 23:22:11 2015 +1030
+++ b/1wire-config.h	Thu Mar 12 23:22:35 2015 +1030
@@ -49,25 +49,25 @@
 #define OWSETREAD() 		do {			\
     GPIO_InitTypeDef GPIO_InitStructure;		\
     							\
-    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;		\
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;		\
     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	\
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; \
-    GPIO_Init(GPIOE, &GPIO_InitStructure);		\
+    GPIO_Init(GPIOC, &GPIO_InitStructure);		\
 } while (0)
 
 
 /* Read the 1-wire bus, non-inverting logic */
-#define OWREADBUS()		(GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_3) ? 1 : 0)
+#define OWREADBUS()		(GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_0) ? 1 : 0)
 
 /* Set the 1-wire bus to 0
  */
 #define OWSETBUSLOW()		do {			\
     GPIO_InitTypeDef GPIO_InitStructure;		\
-    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;		\
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;		\
     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	\
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;	\
-    GPIO_Init(GPIOE, &GPIO_InitStructure);		\
-    GPIO_ResetBits(GPIOE, GPIO_Pin_3);			\
+    GPIO_Init(GPIOC, &GPIO_InitStructure);		\
+    GPIO_ResetBits(GPIOC, GPIO_Pin_0);			\
 } while (0)
 
 /* Set the 1-wire bus to 1
@@ -75,10 +75,10 @@
  */
 #define OWSETBUSHIGH()		do {			\
     GPIO_InitTypeDef GPIO_InitStructure;		\
-    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;		\
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;		\
     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	\
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; \
-    GPIO_Init(GPIOE, &GPIO_InitStructure);		\
+    GPIO_Init(GPIOC, &GPIO_InitStructure);		\
 } while (0)
 
 #define OWDELAY_A delay(6)					/* 6 usec */
--- a/hw.c	Thu Mar 12 23:22:11 2015 +1030
+++ b/hw.c	Thu Mar 12 23:22:35 2015 +1030
@@ -103,7 +103,7 @@
 
     /* USART configuration */
     /* USART1 - 115200 8n1, no flow control TX & RX enabled */
-    USART_InitStructure.USART_BaudRate = 115200;
+    USART_InitStructure.USART_BaudRate = 38400;
     USART_InitStructure.USART_WordLength = USART_WordLength_8b;
     USART_InitStructure.USART_StopBits = USART_StopBits_1;
     USART_InitStructure.USART_Parity = USART_Parity_No;
@@ -270,6 +270,16 @@
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
     GPIO_Init(GPIOE, &GPIO_InitStructure);
 
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9;
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
+    GPIO_Init(GPIOC, &GPIO_InitStructure);
+
+    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12;
+    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
+    GPIO_Init(GPIOA, &GPIO_InitStructure);
+
     /* Setup 1-wire bus */
     OWInit();
 
--- a/tempctrl.c	Thu Mar 12 23:22:11 2015 +1030
+++ b/tempctrl.c	Thu Mar 12 23:22:35 2015 +1030
@@ -68,12 +68,12 @@
 #define TC_MODE_IDLE	'i'	/* Force idle */
 #define TC_MODE_NOTHING	'n'	/* Do nothing (like idle but log nothing) */
     char	mode;
-    
+
     /* GPIO port the heater & cooler are on */
     char	coolport;
     uint16_t	coolpin;
     uint8_t	coolinv;
-    
+
     char 	heatport;
     uint16_t	heatpin;
     uint8_t	heatinv;
@@ -104,15 +104,15 @@
     .minheatontime = 60,
     .minheatofftime = 60,
     .mode = TC_MODE_AUTO,
-    .coolport = 'E',
-    .coolpin = 4,
+    .coolport = 'A',
+    .coolpin = 11,
     .coolinv = 1,
-    .heatport = 'E',
-    .heatpin = 5,
+    .heatport = 'A',
+    .heatpin = 12,
     .heatinv = 1,
     .check_interval = 10,
     .stale_factor = 3,
-    .logfilefmt = "/%Y%M%D.log"
+    .logfilefmt = "\0"
 };
 
 /* Local variable declarations */
@@ -126,7 +126,7 @@
 static int		fmttemp(char *buf, const char *name, int tmp, const char *trailer);
 static GPIO_TypeDef	*char2port(char port);
 
-/* 
+/*
  * tempctrl_init
  *
  */