Commit Graph

365 Commits (370b2708482e82b21e74eda31f9f13400ce71d06)

Author SHA1 Message Date
Bogdan Marinescu 370b270848 Merge pull request #30 from pbrier/master
Experimental fix for issue #29
2013-08-15 03:24:36 -07:00
Bogdan Marinescu 9d846d9902 Merge pull request #31 from adamgreen/gccWarnFixNetwork
Update LPC1768 linker script and silence GNU warnings in network stack
2013-08-15 02:55:51 -07:00
Bogdan Marinescu 092da0d425 Merge pull request #28 from 0xc0170/ticker_chaining_bug
Chaining in Ticker - switched arguments [fix]
2013-08-15 00:36:59 -07:00
Adam Green 282c354ba7 The value of 2 can't fit in a 1 bit wide field.
The phy_speed_100mbs, phy_full_duplex, and phy_link_active fields of
PHY_STATUS_TYPE are 1 bit wide but lpc_phy_init() attempted to
initialize them to a value of 2.  I switched the initializations to
be 0 instead and it still generated the same .bin image.
2013-08-14 20:17:54 -07:00
Adam Green 962dd8bd8f Silence GCC warnings in dhcp.c
The first was a potential out of range index read in dhcp_handle_ack().
The (n < DNS_MAX_SERVERS) check should occur first.  There is also a
documented lwIP bug for this issue here:
    http://savannah.nongnu.org/bugs/?36170

In dhcp_bind() there is no need to perform the NULL check in
ip_addr_isany() for &gw_addr.  Just check (gw_addr.addr == IPADDR_ANY)
instead.

I refactored the chaddr[] copy in dhcp_create_msg() to first copy all
of the valid bytes in hwaddr and then pad the rest of the bytes with 0.
Before it used to check on every destination byte if it should copy or
pad.  GCC originally complained about an index out of range read from
the hwaddr[] array even though it was protected by a conditional
operator.  The refactor makes the intent a bit clearer and saves the
extra comparison per loop iteration.  It also stops GCC from
complaining :)
2013-08-14 20:17:54 -07:00
Adam Green 1cf5243206 Don't call ip_addr_isany() on objects which can't be NULL.
GCC will issue a warning when the ip_addr_isany() macro is used on
a pointer which can never be NULL since the macros NULL check will
always be false:
    #define ip_addr_isany(addr1) ((addr1) == NULL || \
                                  (addr1)->addr == IPADDR_ANY)

In these cases, it is probably clearer to just perform the
x.addr == IPADDR_ANY check inline.
2013-08-14 20:17:54 -07:00
Adam Green 6e95a5ecde Removed extra ALIGNED macro define 2013-08-14 20:17:53 -07:00
Adam Green e014b41377 Silence signed/unsigned comparison warnings in GCC
The dn variable in lpc_low_level_output() was originally defined as a
u32_t but it is later compared to the s32_t return value from
lpc_tx_ready().  Since it is intialized to pbuf_clean() which returns
a u8_t, a s32_t type can safely hold the initial value and remains
consistent with the signed lpc_tx_ready() comparison.

I also modifed writtenLen in TCPSocketConnection::send_all() and
readLen in TCPSocketConnection::recieve_all() to be of type int instead
of size_t.  This is more consistent with their usage within these
methods (they accumulate int ret values and are compared to the int
length value) and their use as a signed integer return values.
2013-08-14 20:17:53 -07:00
Adam Green aa7a55b6dd Update LPC1768.ld linker script to work with net stack.
The original script assigned memory ranges to USB_RAM and ETH_RAM but
it never placed any section data in those regions.  I added clauses
towards the bottom of the script to place data that the programmer
has marked for the AHBSRAM0 and AHBSRAM1 sections into these regions
of RAM.  Previously the data destined for these sections was being
placed in the lower 32K RAM bank and overflowing it at link time.

I also added a few Image$$ linker symbols to mimic those used by the
online compiler.  I have had samples in the past which took advantage
of these to display static memory statistics for each SRAM region.

I also changed LENGTH=0x7F38 to LENGTH=(32K - 0xC8) to make it more
consistent with the sizing of the other regions in this script which
use human readable K sizing information.  The 0xC8 subtraction reflects
the starting offset of 0xC8 for this region.
2013-08-14 20:17:53 -07:00
pbrier ac078485ac Compile network and RTOS with GCC_ARM 2013-08-14 22:52:16 +02:00
pbrier 9011a5453a Compile network and RTOS with GCC_ARM 2013-08-14 22:45:55 +02:00
pbrier c0fdbede02 Compile network and RTOS with GCC_ARM 2013-08-14 22:34:33 +02:00
0xc0170 3d9be83e38 Chaining in Ticker - switched arguments [fix] 2013-08-14 18:22:30 +02:00
Emilio Monti de715aed95 Merge pull request #27 from ytsuboi/master
Fixed some problem around LPC1114 porting
2013-08-14 09:05:52 -07:00
Toyomasa Watarai 9f2a930f31 Fixed GPIO read operation 2013-08-14 22:43:03 +09:00
Toyomasa Watarai b632d8db46 Removed redundant code in serial_api 2013-08-14 22:29:31 +09:00
Toyomasa Watarai 83e065d1bc Fixed missing mask register setting for I2C 2013-08-14 22:28:30 +09:00
Emilio Monti e85d048b1a Merge pull request #26 from 0xc0170/eth_static_mac_address
Eth static mac address
2013-08-14 03:16:35 -07:00
0xc0170 4cbbf8f274 Update eth_static_mac_address from mbed master 2013-08-14 07:29:56 +02:00
0xc0170 74a34c842d default mbed interface for ethernet
- correction in macros, renamimg
2013-08-13 21:49:04 +02:00
Bogdan Marinescu 5ae0e913b1 Merge pull request #24 from adamgreen/gccWarnFixMbedSDK
Update mbed SDK sources to silence GCC warnings
2013-08-13 03:04:42 -07:00
Adam Green 692e666ced Silence signed/unsigned comparison warnings in GCC.
i2c_frequency() compares a uint32_t ref variable to the int hz
function parameter passed in by the caller.  I forced this to be an
uint32_t comparison.

i2c_slave_write() declared i and count variables to be of type uint32_t
but used them as int type throughout the code (in comparisons and
returns) so I switched them to be of signed int type.

spi_frequency() contains a change similar to that made in
i2c_frequency().
2013-08-13 01:47:20 -07:00
Adam Green 461a3dd0d2 Cast to matching enumeration type instead of uint32_t
This commit targets the KL25Z code, whereas previous ones targetted
similar issues in the LPC1768 and LPC11U24 mbed HAL code.

These changes were made to silence GCC warnings and fix potential bugs
where they would never be equal when the enumeration wasn't a 32-bit
type.

For example, pinmap.c used to contain this code:
    if (pin == (uint32_t)NC) return;
I switched it to:
    if (pin == (PinName)NC) return;

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:20 -07:00
Adam Green cc56997a70 Cast to matching enumeration type instead of uint32_t
This commit targets the LPC11U24 code, whereas a previous one
targetted similar issues in the LPC1768 mbed HAL code.

These changes were made to silence GCC warnings and fix potential bugs
where they would never be equal when the enumeration wasn't a 32-bit
type.

For example, pinmap.c used to contain this code:
    if (pin == (uint32_t)NC) return;
I switched it to:
    if (pin == (PinName)NC) return;

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:19 -07:00
Adam Green 8fe7276b98 Silence signed/unsigned comparison warnings in GCC.
Why do the wait APIs take a signed integer if they are going to be
compared to unsigned quantities?
2013-08-13 01:47:19 -07:00
Adam Green c411823656 Fix operator precedence warning in can_api.c
The original code was:
    if(LPC_CAN1->IER | LPC_CAN2->IER != 0) {

This would actually be interpreted as:
    if(LPC_CAN1->IER | (LPC_CAN2->IER != 0)) {
I simplified it to:
    if(LPC_CAN1->IER | LPC_CAN2->IER) {
With the comparison removed, the GCC warning no longer fires since the
user's intent is no longer unclear.  However, the end result should be
the same.
2013-08-13 01:47:19 -07:00
Adam Green 15f833bc1b Cast to matching enumeration type instead of uint32_t
These were done to silence GCC warnings and fix potential bugs where
they would never be equal when the enumeration wasn't a 32-bit type.

For example, common/pinmap_common.c used to contain this code:
    if (pin == (uint32_t)NC)
I switched it to:
    if (pin == (PinName)NC)

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:19 -07:00
Adam Green 3be88a4a6e Add .DS_Store to .gitignore
Instruct git to ignore these OS X files.
2013-08-13 01:47:19 -07:00
0xc0170 4ea25c9ebd Static mac address for ethernet interface
- enables to debug code even with semihosting enabled
2013-08-12 21:56:25 +02:00
Bogdan Marinescu 0e013cf5c8 Added script for building an official release of the mbed library 2013-08-12 13:45:35 +03:00
Bogdan Marinescu 1a47a218a4 [KL25Z] Fixed counter type for i2c_read operations. 2013-08-12 12:31:05 +03:00
Emilio Monti 0843613136 Add LPC11U24/301 TARGET 2013-08-09 17:21:03 +01:00
Emilio Monti d6c658e859 Fix targets.py formatting 2013-08-09 17:18:50 +01:00
Emilio Monti 27d07f4a1d Define all the required symbols in the generated project files 2013-08-08 16:58:37 +01:00
Emilio Monti 239a2f9adf Define all the required symbols in the generated Makefile 2013-08-08 16:39:51 +01:00
Emilio Monti ed2f350000 Merge pull request #23 from arebert/lpc4088
Updated pin mapping and CAN HAL impl for LPC4088 target
2013-08-08 06:53:34 -07:00
Andreas Rebert 75dba19438 Updated pin mapping and CAN HAL for LPC4088 target 2013-08-08 13:57:02 +02:00
Bogdan Marinescu 348c24e578 Added .gitattributes for automatic LF line ending conversion 2013-08-08 13:19:34 +03:00
Bogdan Marinescu 3b465de3aa Changed line endings to LF, removed non-ASCII chars from sources 2013-08-08 12:58:34 +03:00
Bogdan Marinescu 3f703f1bf0 [LPC11C24] Make code compatible with the interrupt chaining code 2013-08-07 15:24:30 +03:00
Bogdan Marinescu 7b9081b59c Add support for calling a function before main()
Also added a test for this feature (MBED_A22).
Fixes PRMBED-906.
2013-08-07 14:51:30 +03:00
Bogdan Marinescu ad5516f898 Add test groups.
Group tests with the same functionality into groups that can be used by autotest.py.
The groups can be overriden from private_settings.py.
2013-08-07 14:51:24 +03:00
Bogdan Marinescu 9ee1fc9f55 [KL25Z] Fix I2C issue related to the silicon errata.
Makes a difference when running the I2C EEPROM test at 400KHz, which has a 100%
success rate after this change.
2013-08-07 14:49:11 +03:00
Bogdan Marinescu 6c05438993 Interrupt chaining: added documentation, fixed a synchronization issue in CallChain. 2013-08-07 14:46:40 +03:00
Bogdan Marinescu d399e51bfd Interrupt chaining: now working on all targets.
Tested on LPC1768, LPC11U24, KL25Z, LPC2368.
2013-08-07 14:43:36 +03:00
Bogdan Marinescu 43d4445074 Interrupt chaining: preliminary version 2013-08-07 14:43:26 +03:00
Bogdan Marinescu 1e8e50996c [KL25Z] Restore full SPI pin mappings 2013-08-07 14:42:02 +03:00
Bogdan Marinescu 58fd85fc6f Add support for calling a function before main()
The name of the function is mbed_main.
Fixes PRMBED-906.
2013-08-07 14:39:13 +03:00
francois.berder@arm.com ffb2668411 Fixed some bugs in HTTPS library 2013-08-07 14:38:07 +03:00
francois.berder@arm.com bd9a31095a Add HTTPS library 2013-08-07 14:36:53 +03:00