Skip to content

LPC81X: reduce code size and add ARM_GCC support #1299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2015
Merged

LPC81X: reduce code size and add ARM_GCC support #1299

merged 1 commit into from
Sep 1, 2015

Conversation

claplace
Copy link
Contributor

LPC810 has only 4KB of flash, thus avoiding dead code is really nice.
Here the NVIC interrupt setup was pulled from the us_ticker code even
if no code is using timer events.

This also adds ARM_GCC support for TARGET_LPC81X.

LPC81X and LPC82X support Cortex M0+ VTOR register, so it is not
necessary to put non-init text at 0x200.

LPC810 has only 4KB of flash, thus avoiding dead code is really nice.
Here the NVIC interrupt setup was pulled from the us_ticker code even
if no code is using timer events.

This also adds ARM_GCC support for TARGET_LPC81X.

LPC81X and LPC82X support Cortex M0+ VTOR register, so it is not
necessary to put non-init text at 0x200.
@claplace
Copy link
Contributor Author

FYI my mbed account (I signed cla): users/cyprien

else if (pin == P0_5)
enable = 1 << 6;
LPC_SWM->PINENABLE0 |= enable;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide details for this addition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LPC81X family does not have a conventional list of functions per pin, but instead each pin can received any of the "movable" functions. The only exceptions are known as "fixed-pin functions" and are nEnabled using the PINENABLE0 register (1 == disabled). On boot 3 of these fixed functions are enabled:

  • SWDIO_EN is set on P0_2
  • SWCLK_EN is set on P0_3
  • RESET_EN is set on P0_5

If you want to use one of those pins as GPIO, you must first disable the fixed-pin function, and they'll return to their default GPIO function.

However you usually don't want to disable the RESET or the SW functions, but on a LPC810 package that has only 8 pins, this is more than appreciable.

@claplace
Copy link
Contributor Author

Does it look ok?

@claplace
Copy link
Contributor Author

claplace commented Sep 1, 2015

@0xc0170 Hi, is there anything missing? Do you want more comments in the code?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 1, 2015

LGTM

0xc0170 added a commit that referenced this pull request Sep 1, 2015
LPC81X: reduce code size and add ARM_GCC support
@0xc0170 0xc0170 merged commit 483bb01 into ARMmbed:master Sep 1, 2015
@claplace claplace deleted the lpc81x branch September 1, 2015 14:46
c1728p9 added a commit to c1728p9/mbed-os that referenced this pull request Jun 16, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  ARMmbed#1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  ARMmbed#1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  ARMmbed#1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  ARMmbed#1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  ARMmbed#1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  ARMmbed#1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit that referenced this pull request Jul 31, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit that referenced this pull request Oct 3, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit that referenced this pull request Nov 2, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
juhaylinen pushed a commit to juhaylinen/mbed-os that referenced this pull request Nov 12, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  ARMmbed#1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  ARMmbed#1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  ARMmbed#1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  ARMmbed#1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  ARMmbed#1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  ARMmbed#1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
cmonr pushed a commit that referenced this pull request Nov 29, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
cmonr pushed a commit that referenced this pull request Dec 4, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit that referenced this pull request Dec 19, 2018
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit to c1728p9/mbed-os that referenced this pull request Jan 17, 2019
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  ARMmbed#1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  ARMmbed#1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  ARMmbed#1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  ARMmbed#1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  ARMmbed#1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  ARMmbed#1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit that referenced this pull request Jan 29, 2019
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  #1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  #1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  #1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  #1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  #1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  #1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
c1728p9 added a commit to c1728p9/mbed-os that referenced this pull request Feb 22, 2019
Fix the following warnings:
-[Warning] USBTester.cpp@45,0:  ARMmbed#1299-D: members and base-classes will
    be initialized in declaration order, not in member initialisation
    list order
-[Warning] USBTester.h@41,0:  ARMmbed#1300-D: ~USBTester inherits implicit
    virtual
-[Warning] USBAudio.cpp@345,0:  ARMmbed#1035-D: single-precision operand
    implicitly converted to double-precision
-[Warning] USBHID.cpp@29,0:  ARMmbed#1300-D: ~AsyncSend inherits implicit
    virtual
-[Warning] USBHID.cpp@61,0:  ARMmbed#1300-D: ~AsyncRead inherits implicit
    virtual
-[Warning] USBHID.cpp@93,0:  ARMmbed#1300-D: ~AsyncWait inherits implicit
    virtual
-[Warning] EndpointResolver.cpp@125,26: '<<' in boolean context, did
    you mean '<' ? [-Wint-in-bool-context]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants