[riot-notifications] [RIOT-OS/RIOT] SAM3: macro LED0_TOGGLE not working (#7613)
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications