Support more bus types (part 2 of 2). Originally libsensors was very

i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.

This second part updates sensors_bus to use sensors_bus_id. Thanks
to Mark M. Hoffman for showing me how the configuration file
parser could be modified to support that change.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4687 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-08-19 15:04:29 +00:00
1 parent 7ee15371df
commit a74addb5d4
5 files changed
+24 -21

No files matched your search

+7 -7
View File
@@ -94,7 +94,7 @@ static sensors_chip *current_chip = NULL;
void *nothing;
sensors_chip_name_list chips;
sensors_expr *expr;
int bus;
sensors_bus_id bus;
sensors_chip_name chip;
int line;
}
@@ -118,7 +118,7 @@ static sensors_chip *current_chip = NULL;
%type <chips> chip_name_list
%type <expr> expression
%type <bus> i2cbus_name
%type <bus> bus_id
%type <name> adapter_name
%type <name> function_name
%type <name> string
@@ -141,10 +141,10 @@ line: bus_statement EOL
| error EOL
;
bus_statement: BUS i2cbus_name adapter_name
bus_statement: BUS bus_id adapter_name
{ sensors_bus new_el;
new_el.lineno = $1;
new_el.number = $2;
new_el.bus = $2;
new_el.adapter = $3;
bus_add_el(&new_el);
}
@@ -287,11 +287,11 @@ expression: FLOAT
}
;
i2cbus_name: NAME
{ int res = sensors_parse_i2cbus_name($1,&$$);
bus_id: NAME
{ int res = sensors_parse_bus_id($1,&$$);
free($1);
if (res) {
sensors_yyerror("Parse error in i2c bus name");
sensors_yyerror("Parse error in bus id");
YYERROR;
}
}