i2c.c (228660) | i2c.c (230356) |
---|---|
1/*- 2 * Copyright (C) 2008-2009 Semihalf, Michal Hajduk and Bartlomiej Sieka 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2008-2009 Semihalf, Michal Hajduk and Bartlomiej Sieka 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/usr.sbin/i2c/i2c.c 228660 2011-12-17 20:12:17Z dim $"); | 28__FBSDID("$FreeBSD: head/usr.sbin/i2c/i2c.c 230356 2012-01-20 01:38:44Z eadler $"); |
29 30#include <err.h> 31#include <errno.h> 32#include <sysexits.h> 33#include <fcntl.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <string.h> --- 422 unchanged lines hidden (view full) --- 459 return (1); 460} 461 462int 463main(int argc, char** argv) 464{ 465 struct iiccmd cmd; 466 struct options i2c_opt; | 29 30#include <err.h> 31#include <errno.h> 32#include <sysexits.h> 33#include <fcntl.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <string.h> --- 422 unchanged lines hidden (view full) --- 459 return (1); 460} 461 462int 463main(int argc, char** argv) 464{ 465 struct iiccmd cmd; 466 struct options i2c_opt; |
467 char *dev, *skip_addr, *err_msg, *i2c_buf; | 467 char *dev, *skip_addr, *i2c_buf; |
468 int error, chunk_size, i, j, ch; 469 470 errno = 0; 471 error = 0; 472 473 /* Line-break the output every chunk_size bytes */ 474 chunk_size = 16; 475 476 dev = I2C_DEV; | 468 int error, chunk_size, i, j, ch; 469 470 errno = 0; 471 error = 0; 472 473 /* Line-break the output every chunk_size bytes */ 474 chunk_size = 16; 475 476 dev = I2C_DEV; |
477 err_msg = NULL; | |
478 479 /* Default values */ 480 i2c_opt.addr_set = 0; 481 i2c_opt.off = 0; 482 i2c_opt.verbose = 0; 483 i2c_opt.dir = 'r'; /* direction = read */ 484 i2c_opt.width = 8; 485 i2c_opt.count = 1; --- 148 unchanged lines hidden --- | 477 478 /* Default values */ 479 i2c_opt.addr_set = 0; 480 i2c_opt.off = 0; 481 i2c_opt.verbose = 0; 482 i2c_opt.dir = 'r'; /* direction = read */ 483 i2c_opt.width = 8; 484 i2c_opt.count = 1; --- 148 unchanged lines hidden --- |