diff --git a/Makefile b/Makefile index 4d82140..7fa6b32 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,3 @@ flash: $(P)-0x00000.bin clean: rm -f $(P) $(OBJ) $(P)-0x00000.bin $(P)-0x10000.bin *~ - -library: - $(CC) -c -fPIC $(CFLAGS) $(P).c -o $(P).o - $(AR) rcs lib$(P).a $(P).o diff --git a/mqtt.h b/mqtt.h index a593341..22ef4ed 100644 --- a/mqtt.h +++ b/mqtt.h @@ -100,7 +100,7 @@ void ICACHE_FLASH_ATTR reconnected_callback(void *arg, sint8 err); /** * A callback function which is called when TCP connection is successful. * @param *arg A pointer to void, which needs to be cast to espconn *pConn - * @returns Void + * @return Void * * This function is called once the TCP connection to the server is completed. This allows us to register the callbacks for received and sent data, as well as enable TCP keepalive and set validConnection in mqtt_session_t to 1 to show the connection has been successful. */ diff --git a/onewire.c b/onewire.c index ce22697..c6a8208 100644 --- a/onewire.c +++ b/onewire.c @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include #include "os_type.h" #include "osapi.h" @@ -5,7 +9,7 @@ #include "gpio.h" #include "onewire.h" -#define OWBUS BIT5 +#define OWBUS BIT5 /**< This define determines which pin is used */ sint8 ICACHE_FLASH_ATTR reset(void) { uint32_t time; diff --git a/onewire.h b/onewire.h index 9993365..0da4c8d 100644 --- a/onewire.h +++ b/onewire.h @@ -1,7 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include #include "os_type.h" #include "gpio.h" +/** + * @file + * @brief This is the header file for the one-wire library + */ + /** * @struct oneWire_t * Structure that holds all the information about onewire connections, including the 64-bit ROM address for each device and some buffer memory to read out the scratchpad @@ -29,5 +38,15 @@ typedef enum { E2_RECALL = 0xB8 } ds18b20_cmds; +/** + * Function sends a reset pulse on the one-wire bus and checks for a presence pulse + * @return 0 if no presence, 1 if presence + */ sint8 ICACHE_FLASH_ATTR reset(void); + +/** + * Function which handles all one-wire communication besides the reset sequence. + * @param owDev A pointer to the oneWire_t variable for this device + * @param cmd One of the commands from ds18b20_cmds + */ void ICACHE_FLASH_ATTR transact(oneWire_t *owDev, ds18b20_cmds cmd);