[riot-notifications] [RIOT-OS/RIOT] SAM3: macro LED0_TOGGLE not working (#7613)

Sebastian Meiling notifications at github.com
Mon Sep 18 11:24:57 CEST 2017


smlng requested changes on this pull request.

Nice catch! Reading the referenced data sheet pages, you're right about the issue.

> @@ -56,6 +56,9 @@ void cpu_init(void)
     /* unlock write protect register for PMC module */
     PMC->PMC_WPMR = PMC_WPMR_WPKEY(WPKEY);
 
+    /* enable Synchronous Data Output for PIOB */
+    PIOB->PIO_OWER = ~0l;

I would rather not enable write on all pins. As you pointed out already, one could either limit this to the specific pin for LED0 (PB27) *or* use set/clear calls instead. The problem with using `PIO_OWER` is that is has to be set somewhere else not related to the toggle operation, so if one doesn't use LED0 its still set. 

I personally would rather go for something like:

```
#define LED0_TOGGLE         ((PIOB->PIO_ODSR) ?  LED0_OFF : LED0_ON)
```

if that is possible and works - I don't have a sam3 based boards for testing 😞 

-- 
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/7613#pullrequestreview-63294534
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170918/cd80c38e/attachment-0001.html>


More information about the notifications mailing list