Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: FourDigitLED.cpp
- Revision:
- 2:c4e8b2fd8f7e
- Parent:
- 1:c94aa39af4c7
- Child:
- 3:73f31aea935a
--- a/FourDigitLED.cpp Fri Jun 26 08:01:58 2015 +0000 +++ b/FourDigitLED.cpp Wed Jul 01 22:05:56 2015 +0000 @@ -36,9 +36,17 @@ LEDs->write(~(0x100 << d) & 0xff00 | (val[d] & 0xff) ) ; } -unsigned int FourDigitLED::setPtn(int d, unsigned int ptn) +unsigned int FourDigitLED::getPtn(int d) { - val[d] = ptn & 0xff; + if((d>=0) && (d<=sizeof(SegPattern))) + return SegPattern[d] ; + else + return 0 ; +} + +unsigned int FourDigitLED::setPtn(int d, unsigned int ptn, unsigned int mask) +{ + val[d] = (val[d] & 0xff80) | (ptn & mask); return ptn ; }