diff -Naur owfs-2.9p0/module/owlib/src/c/ow_1921.c owfs-2.9p0-6/module/owlib/src/c/ow_1921.c --- owfs-2.9p0/module/owlib/src/c/ow_1921.c 2012-12-15 15:28:40.000000000 +0100 +++ owfs-2.9p0-6/module/owlib/src/c/ow_1921.c 2013-05-02 13:27:40.522908400 +0200 @@ -98,6 +98,7 @@ WRITE_FUNCTION(FS_w_controlrbit); READ_FUNCTION(FS_r_statusbit); WRITE_FUNCTION(FS_w_statusbit); +WRITE_FUNCTION(FS_clrmem); /* ------- Structures ----------- */ #define HISTOGRAM_DATA_ELEMENTS 63 @@ -174,7 +175,7 @@ {"mission", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission/enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlrbit, FS_w_controlrbit, VISIBLE, {u:_MASK_DS1921_MISSION_ENABLE}, }, - {"mission/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlbit, FS_w_controlbit, INVISIBLE, {u:_MASK_DS1921_CLEAR_MEMORY}, }, + {"mission/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, NO_READ_FUNCTION, FS_clrmem, VISIBLE, {u:_MASK_DS1921_CLEAR_MEMORY}, }, {"mission/running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, FS_w_mip, VISIBLE, {v:&BitReads[1]}, }, {"mission/frequency", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_samplerate, FS_w_samplerate, VISIBLE, NO_FILETYPE_DATA, }, {"mission/samples", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_3byte, NO_WRITE_FUNCTION, VISIBLE, {s:0x021A}, }, @@ -346,6 +347,15 @@ return FS_w_sibling_bitwork( Y, mask, "ControlRegister", owq ) ; } +static ZERO_OR_ERROR FS_clrmem(struct one_wire_query *owq) +{ + /* clear memory */ + if OWQ_Y(owq) { + return GB_to_Z_OR_E( OW_clearmemory(PN(owq)) ) ; + } + return 0; +} + static ZERO_OR_ERROR FS_r_statusbit(struct one_wire_query *owq) { UINT U = 0 ; @@ -887,6 +897,9 @@ /* write 0x020E -- 0x0214 */ BYTE data[] = { 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + /* clear memory */ + RETURN_BAD_IF_BAD( OW_clearmemory(PN(owq))) ; + /* Stop clock, no rollover, no delay, temp alarms on, alarms cleared */ if ( BAD( OW_w_mem(data, 7, 0x020E, PN(owq)) ) ) { return -EINVAL; @@ -1109,8 +1122,10 @@ static GOOD_OR_BAD OW_stopmission(struct parsedname *pn) { - BYTE data = 0x00; /* dummy */ - return OW_small_read(&data, 1, 0x0210, pn); + /* write 0 to bit 5 of status register 0x0214 to stop the mission */ + BYTE data = 0xDF; + + return OW_w_mem(&data, 1, 0x0214, pn); } static GOOD_OR_BAD OW_startmission(UINT freq, struct parsedname *pn) @@ -1136,9 +1151,6 @@ UT_delay(1000); /* wait for the clock to count a second */ } - /* clear memory */ - RETURN_BAD_IF_BAD( OW_clearmemory(pn)) ; - /* finally, set the sample interval (to start the mission) */ data = BYTE_MASK(freq); return OW_w_mem(&data, 1, 0x020D, pn); diff -Naur owfs-2.9p0/src/man/DS1921.3 owfs-2.9p0-6/src/man/DS1921.3 --- owfs-2.9p0/src/man/DS1921.3 2012-09-21 22:19:43.000000000 +0200 +++ owfs-2.9p0-6/src/man/DS1921.3 2013-05-02 13:27:40.538508400 +0200 @@ -8,11 +8,11 @@ '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id: DS1921.3,v 1.21 2012/07/15 16:57:04 alfille Exp $ '\" -.TH DS1921-Thermachron 3 2005 "OWFS Manpage" "One-Wire File System" +.TH DS1921-Thermochron 3 2005 "OWFS Manpage" "One-Wire File System" .SH NAME .TP .B DS1921 -Thermachron temperature logging iButton. +Thermochron temperature logging iButton. .SH SYNOPSIS Temperature logging iButton. .PP @@ -86,7 +86,7 @@ Lowest temperature this .I DS1921 can measure (in the current temperature scale). -.SS abount/version +.SS about/version .I read-only, ascii .br Specific @@ -317,11 +317,7 @@ .I mission the .B DS1921 (3) -records temperature readings in a 2048-sample log and adds the to 62-bin histogram. more complete form of the -.B DS2438 (3) -battery chip. Current sensing is available, but not implemented. The major advantage compared to the -.B DS2436 (3) -is that two voltages can be read, allowing correcting circuit nmeasurements to supply voltage and temperature. +records temperature readings in a 2048-sample log and adds them to a 62-bin histogram. .SH ADDRESSING .so addressing.3so .SH DATASHEET diff -Naur owfs-2.9p0/src/man/DS2438.3 owfs-2.9p0-6/src/man/DS2438.3 --- owfs-2.9p0/src/man/DS2438.3 2012-09-21 22:19:44.000000000 +0200 +++ owfs-2.9p0-6/src/man/DS2438.3 2013-05-02 13:27:40.538508400 +0200 @@ -334,7 +334,7 @@ .B DS2436 battery chip. Current sensing is available, but not implemented. The major advantage compared to the .B DS2436 -is that two voltages can be read, allowing correcting circuit nmeasurements to supply voltage and temperature. A better comparison is the +is that two voltages can be read, allowing correcting circuit measurements to supply voltage and temperature. A better comparison is the .B DS276x family of chips. .SH ADDRESSING