Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

homework #49

Open
wants to merge 2 commits into
base: Alexandr.Nikitin
Choose a base branch
from

Conversation

sashanikitin
Copy link

mpu6050 with kthread

Copy link
Collaborator

@AleksandrBulyshchenko AleksandrBulyshchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review is quite shallow and without testing.

The exercise overall is done, despite doesn't fully conform the task.
But:

  • All the changes merged into baseline sources, which make it almost impossible to provide normal review;
  • No description of what is done;
  • ${KERNEL_SOURCE}/scripts/checkpatch.pl --file lesson-8-Character-Devices/*.c --terse:
    total: 45 errors, 49 warnings, 285 lines checked.

The PR should be formatted according to the wiki.

static struct i2c_driver mpu6050_i2c_driver = { .driver =
{ .name = "gl_mpu6050", },

.probe = mpu6050_probe, .remove = mpu6050_remove, .id_table = mpu6050_idtable, };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code formatting is just fantastic sometime.

if (kthread_should_stop()) {
do_exit(0);
}
mpu6050_read_data(&g_mpu6050_data[number]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This's not a big deal, but, AFAIR, the task was to read sensor data only by request (but not more often than once per second) - not each second.

But there's an actual issue - no synchronization between reading and writing number and g_mpu6050_data[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants