Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Fix product type and featureset detection
Browse files Browse the repository at this point in the history
Update copyright year to 2018
Add LICENSE file
  • Loading branch information
abrauchli committed Mar 21, 2018
1 parent 2e4972a commit 864517c
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017, Sensirion AG
Copyright (c) 2018, Sensirion AG
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion embedded-common
Submodule embedded-common updated 2 files
+2 −0 AUTHORS
+13 −11 README.md
2 changes: 1 addition & 1 deletion sgp-common/sgp_featureset.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions sgp30/sgp30.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -766,7 +766,7 @@ u8 sgp_get_configured_address() {
*/
s16 sgp_get_feature_set_version(u16 *feature_set_version, u8 *product_type) {
*feature_set_version = client_data.info.feature_set_version & 0x00FF;
*product_type = (u8)((client_data.info.feature_set_version & 0xC0000) >> 14);
*product_type = (u8)((client_data.info.feature_set_version & 0xF000) >> 12);
return STATUS_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion sgp30/sgp30.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion sgp30/sgp30_example_usage.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion sgp30/sgp30_featureset.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
10 changes: 4 additions & 6 deletions sgpc3/sgpc3.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -341,7 +341,6 @@ static u16 sgp_fill_cmd_send_buf(u8 *buf, const sgp_command *cmd,
*/
static s16 sgp_detect_featureset_version(u16 *featureset) {
s16 i, j;
s16 ret = STATUS_FAIL;
u16 feature_set_version = be16_to_cpu(*featureset);
const struct sgp_otp_featureset *sgp_featureset;

Expand All @@ -353,12 +352,11 @@ static s16 sgp_detect_featureset_version(u16 *featureset) {
if (SGP_FS_COMPAT(feature_set_version,
sgp_featureset->supported_featureset_versions[j])) {
client_data.otp_features = sgp_featureset;
ret = STATUS_OK;
break;
return STATUS_OK;
}
}
}
return ret;
return STATUS_FAIL;
}


Expand Down Expand Up @@ -852,7 +850,7 @@ u8 sgp_get_configured_address() {
*/
s16 sgp_get_feature_set_version(u16 *feature_set_version, u8 *product_type) {
*feature_set_version = client_data.info.feature_set_version & 0x00FF;
*product_type = (u8)((client_data.info.feature_set_version & 0xC0000) >> 14);
*product_type = (u8)((client_data.info.feature_set_version & 0xF000) >> 12);
return STATUS_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion sgpc3/sgpc3.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion sgpc3/sgpc3_example_usage.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion sgpc3/sgpc3_featureset.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Sensirion AG
* Copyright (c) 2018, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down

0 comments on commit 864517c

Please sign in to comment.