This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [mbed] Working path "/Users/wwalker/tmp" (directory) | |
| [mbed] Importing program "BBB" from "git@github.com:wdwalker/BBB" at latest revision in the current branch | |
| [mbed] Exec "git clone git@github.com:wdwalker/BBB /Users/wwalker/tmp/BBB -v" in /Users/wwalker/tmp | |
| Cloning into '/Users/wwalker/tmp/BBB'... | |
| remote: Counting objects: 136, done. | |
| remote: Compressing objects: 100% (3/3), done. | |
| remote: Total 136 (delta 0), reused 0 (delta 0), pack-reused 133 | |
| Receiving objects: 100% (136/136), 42.00 KiB | 0 bytes/s, done. | |
| Resolving deltas: 100% (72/72), done. | |
| [mbed] Query "git remote -v" in /Users/wwalker/tmp/BBB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Enable CLKOUT on pin 43 (P1.27) and have it show the CPU clock | |
| * divided by 16. (p68, p120). | |
| */ | |
| LPC_SC->CLKOUTCFG = 0x000001F0; | |
| LPC_PINCON->PINSEL3 &= ~((1 << 23) | (1 << 22)); | |
| LPC_PINCON->PINSEL3 |= (1 << 22); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Link-Options.html | |
| LDFLAGS = \ | |
| -nodefaultlibs \ | |
| -T "LPC1768.ld" \ | |
| -Wl,--gc-sections \ | |
| -Wl,-Map,"BBB.map" \ | |
| -Wl,--start-group -lgcc -lc -lm $(RDIMONLIB) -Wl,--end-group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Diagnostic-Message-Formatting-Options.html | |
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/C-Dialect-Options.html#C-Dialect-Options | |
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Code-Gen-Options.html | |
| ASFLAGS = \ | |
| $(ARM_FLAGS) \ | |
| $(WARNING_FLAGS) \ | |
| -fmessage-length=0 \ | |
| $(OPTIMIZE) \ | |
| -ffunction-sections \ | |
| -fdata-sections \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define DEBUG to anything if you want debug enabled. | |
| # | |
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Optimize-Options.html#Optimize-Options | |
| # http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0205g/Bgbjjgij.html | |
| # https://mcuoneclipse.com/2015/05/27/semihosting-for-kinetis-design-studio-v3-0-0-and-gnu-arm-embedded-launchpad/ | |
| DEBUG= | |
| ifdef DEBUG | |
| OPTIMIZE=-Os -g -DDEBUG | |
| RDIMONSPECS = --specs=rdimon.specs | |
| RDIMONLIB = -lrdimon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Preprocessor-Options.html | |
| CPPFLAGS = \ | |
| -MMD \ | |
| -MF"$(@:%.o=%.d)" \ | |
| -MT"$(@)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Warning-Options.html | |
| WARNING_FLAGS = \ | |
| -Wall \ | |
| -Wextra \ | |
| -pedantic \ | |
| -Wbad-function-cast \ | |
| -Wconversion \ | |
| -Wfloat-equal \ | |
| -Wlogical-op \ | |
| -Wmissing-declarations \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/ARM-Options.html | |
| ARM_FLAGS = \ | |
| -mthumb \ | |
| -mcpu=cortex-m3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Turn the LEDs on and off at roughly 1Hz. | |
| */ | |
| while (1) { | |
| LPC_GPIO1->FIOSET |= ALL; /* p132 */ | |
| delay_ms(500); | |
| LPC_GPIO1->FIOCLR |= ALL; /* p132 */ | |
| delay_ms(500); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define P18 (1 << 18) | |
| #define P20 (1 << 20) | |
| #define P21 (1 << 21) | |
| #define P23 (1 << 23) | |
| #define ALL (P18 | P20 | P21 | P23) | |
| ... | |
| /* Set the direction as output by setting the associated bits |