analogdevicesinc / EVAL-ADICUP3029

This repo includes examples which run on the EVAL-ADICUP3029 ARM Cortex-M3 processor development platform from Analog Devices.
https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029
Other
38 stars 63 forks source link

Cn04289 v2 #47

Closed MRaninecADI closed 4 years ago

MRaninecADI commented 4 years ago

This is a branch containing updated version of the CN0428_CN0429 reference design firmware. Please review these changes and merge with master if all good. Thanks!

MRaninecADI commented 4 years ago

Hi Mihail,

Thanks for your feedback. I addressed all the points you highlighted below and pushed the changes to the cn04289_v2 branch. Is there anything else you need me to do before we can publish this?

Best Regards, Michal

From: Mihail Chindris notifications@github.com Sent: Friday, March 20, 2020 14:19 To: analogdevicesinc/EVAL-ADICUP3029 EVAL-ADICUP3029@noreply.github.com Cc: Raninec, Michal Michal.Raninec@analog.com; Assign assign@noreply.github.com Subject: Re: [analogdevicesinc/EVAL-ADICUP3029] Cn04289 v2 (#47)

[External]

@mchindri commented on this pull request.


In projects/ADuCM3029_demo_cn0428_cn0429_v2/src/adi_m355_gas_sensor.cpphttps://github.com/analogdevicesinc/EVAL-ADICUP3029/pull/47#discussion_r395585940:

+{

+

+/*

+SENSOR_RESULT M355_GAS::open()

+{

+}

+

+/*

+SENSOR_RESULT M355_GAS::openWithAddr(uint8_t sensor_address)

There is no need for other name for open in c++. You can have both M355_GAS::open() and M355_GAS::open(uint8_t sensor_address) and works fine due to c++ function overloading


In projects/ADuCM3029_demo_cn0428_cn0429_v2/src/adi_gas_sensor.hhttps://github.com/analogdevicesinc/EVAL-ADICUP3029/pull/47#discussion_r395588634:

+

+#ifndef ADI_GAS_SENSORH

+#define ADI_GAS_SENSORH

+

+#include "base_sensor/adi_sensor.h"

+#include "adi_m355_gas_sensor_config.h"

+

+namespace adi_sensor_swpack

+{

+/**

+class Gas_Reading: public Sensor

Wouldn't Gas_Sensor be a better naming than Gas_Reading?


In projects/ADuCM3029_demo_cn0428_cn0429_v2/src/adi_m355_gas_sensor.cpphttps://github.com/analogdevicesinc/EVAL-ADICUP3029/pull/47#discussion_r395646266:

  • uint32_t nHwErrors;

⬇️ Suggested change

This way is not needed the if else statement and write almost the same code in each block. Or an other idea is to create a function for read and a function for write.


In projects/ADuCM3029_demo_cn0428_cn0429_v2/src/adi_m355_gas_sensor.cpphttps://github.com/analogdevicesinc/EVAL-ADICUP3029/pull/47#discussion_r395654110:

  • pBuff = &new_I2C_address;

+

It looks a bit confusing to me the open and close instruction. Wouldn't be better to send the i2c change command inside this function? Also with the 2 calls to open, the I2C device is initialized twice. I think this is not needed.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/analogdevicesinc/EVAL-ADICUP3029/pull/47#pullrequestreview-378417195, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALC5L7H6EIZKMFDITAHN633RIN3OXANCNFSM4LPL4VSA.

adrimbarean commented 4 years ago

Ideally we don't want commits that fix code written in this patch. The changes we request can be done in the commit they are signaled in by rebasing interactively.

MRaninecADI commented 4 years ago

Hi Andrei! I rebased the branch and added two commits as per your requirements. Can you please check if it is okay now? Thanks!

MRaninecADI commented 4 years ago

I addressed your recommendations and commented in this conversation where needed. All changes are committed and I rebased the branch again.

MRaninecADI commented 4 years ago

Thanks Andrei!