[riot-notifications] [RIOT-OS/RIOT] drivers/io1_xplained: fix gpios devices initialization (#8960)

Alexandre Abadie notifications at github.com
Mon Apr 16 11:48:57 CEST 2018


aabadie commented on this pull request.



> @@ -73,8 +73,8 @@ void auto_init_io1_xplained(void)
 
         /* GPIOs */
         for (unsigned j = 1; j < 4; j++) {
-            saul_entries[i * 4 + j].dev = &(io1_xplained_saul_gpios[j]);
-            saul_entries[i * 4 + j].name = io1_xplained_saul_info[i][j].name;
+            saul_entries[i * 4 + j].dev = &(io1_xplained_saul_gpios[j - 1]);
+            saul_entries[i * 4 + j].name = io1_xplained_saul_info[i][j - 1].name;

> I know this is maybe a hair splitting style thing

I wanted the loop to start at 1 to keep some kind of continuity of the registered devices in the saul registry: 0 is for the temperature sensor, 1 for GPIO LED, 2 and 3 for GPIO pins

But ok, your suggestion makes sense.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/8960#discussion_r181678576
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20180416/bcf954a1/attachment.html>


More information about the notifications mailing list