changeset 7:78983502a4e9

Use base 16 for IO port values
author Daniel O'Connor <darius@dons.net.au>
date Sun, 15 Feb 2015 17:47:25 +1030
parents 7b9a1affcc94
children c32b5792683a
files sprink.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sprink.c	Sun Feb 15 16:55:59 2015 +1030
+++ b/sprink.c	Sun Feb 15 17:47:25 2015 +1030
@@ -1,7 +1,7 @@
 /*
  * Sprinkler relay control
  *
- * Copyright (c) 2009
+ * Copyright (c) 2015
  *      Daniel O'Connor <darius@dons.net.au>.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -259,7 +259,7 @@
 	    return;
 	}
 
-	val = strtol(argv[2], &eptr, 0);
+	val = strtol(argv[2], &eptr, 16);
 	if (eptr == argv[2]) {
 	    printf_P(PSTR("Unable to parse val\r\n"));
 	    return;
@@ -320,7 +320,7 @@
 	    }
 	    printf_P(PSTR("DDR%c => 0x%02x\r\n"), toupper(argv[1][0]), val);
 	} else {
-	    val = strtol(argv[2], &eptr, 0);
+	    val = strtol(argv[2], &eptr, 16);
 	    if (eptr == argv[2]) {
 		printf_P(PSTR("Unable to parse val\r\n"));
 		return;