Skip to content

Commit fabaa2e

Browse files
committed
merge 2.x changes into master; touch up Makefile CFLAGS logic
2 parents b7591cf + 922006d commit fabaa2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1493
-52
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@
2424
path = atmel-samd/asf4
2525
url = https://github.com/adafruit/asf4.git
2626
branch = circuitpython
27+
[submodule "frozen/Adafruit_CircuitPython_Thermistor"]
28+
path = frozen/Adafruit_CircuitPython_Thermistor
29+
url = https://github.com/adafruit/Adafruit_CircuitPython_Thermistor.git
30+
[submodule "frozen/Adafruit_CircuitPython_LIS3DH"]
31+
path = frozen/Adafruit_CircuitPython_LIS3DH
32+
url = https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH.git
33+
[submodule "frozen/Adafruit_CircuitPython_BusDevice"]
34+
path = frozen/Adafruit_CircuitPython_BusDevice
35+
url = https://github.com/adafruit/Adafruit_CircuitPython_BusDevice.git

atmel-samd/Makefile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,37 @@ BASE_CFLAGS = \
8080
--param max-inline-insns-single=500
8181

8282
# NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt.
83+
8384
ifeq ($(CHIP_FAMILY), samd21)
84-
CFLAGS = -Os -DNDEBUG -finline-limit=49
85+
CFLAGS = -Os -DNDEBUG
8586
endif
87+
8688
ifeq ($(CHIP_FAMILY), samd51)
8789
CFLAGS = -O2 -DNDEBUG
8890
endif
8991

9092
#Debugging/Optimization
9193
ifeq ($(DEBUG), 1)
92-
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
93-
CFLAGS += -ggdb
94-
ifeq ($(CHIP_FAMILY), samd21)
95-
CFLAGS += -DNDEBUG -DENABLE_MICRO_TRACE_BUFFER
96-
endif
94+
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
95+
CFLAGS += -ggdb
96+
ifeq ($(CHIP_FAMILY), samd21)
97+
CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
98+
endif
9799
else
98-
# -finline-limit can shrink the image size. -finline-limit=80 or so is similar to not having it on.
99-
# There is no simple default value, though.
100-
CFLAGS += -DNDEBUG -flto -finline-limit=49
100+
# -finline-limit can shrink the image size.
101+
# -finline-limit=80 or so is similar to not having it on.
102+
# There is no simple default value, though.
103+
ifeq ($(FLASH_IMPL),internal_flash.c)
104+
ifeq ($(CHIP_FAMILY), samd21)
105+
CFLAGS += -finline-limit=19
106+
endif
107+
endif
108+
CFLAGS += -flto
101109
endif
102110

103111
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
104112

113+
105114
ifeq ($(CHIP_FAMILY), samd21)
106115
CFLAGS += \
107116
-mthumb \
@@ -262,7 +271,8 @@ SRC_BINDINGS_ENUMS = \
262271
digitalio/Direction.c \
263272
digitalio/DriveMode.c \
264273
digitalio/Pull.c \
265-
help.c
274+
help.c \
275+
util.c
266276

267277
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
268278
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
@@ -274,6 +284,8 @@ SRC_SHARED_MODULE = \
274284
bitbangio/OneWire.c \
275285
bitbangio/SPI.c \
276286
busio/OneWire.c \
287+
gamepad/__init__.c \
288+
gamepad/GamePad.c \
277289
os/__init__.c \
278290
random/__init__.c \
279291
storage/__init__.c \

atmel-samd/boards/circuitplayground_express/mpconfigboard.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ CHIP_VARIANT = SAMD21G18A
99
CHIP_FAMILY = samd21
1010

1111
# Include these Python libraries in firmware.
12+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
13+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
1214
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
15+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor

atmel-samd/boards/flash_W25Q32BV.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_BOARD_FLASH_W25Q32BV_H
28+
#define MICROPY_INCLUDED_ATMEL_SAMD_BOARD_FLASH_W25Q32BV_H
29+
30+
// The total flash size in bytes.
31+
#define SPI_FLASH_TOTAL_SIZE (1 << 21) // 2 MiB
32+
33+
// The size of the smallest erase unit thats erased with command 0x20.
34+
#define SPI_FLASH_ERASE_SIZE (1 << 12) // 4 KiB
35+
36+
// The size of a page that is programmed with page program command 0x02.
37+
#define SPI_FLASH_PAGE_SIZE (256) // 256 bytes
38+
39+
// These are the first three response bytes to the JEDEC ID command 0x9f that is
40+
// used to confirm we're talking to the flash we expect.
41+
#ifndef SPI_FLASH_JEDEC_MANUFACTURER
42+
#define SPI_FLASH_JEDEC_MANUFACTURER 0xef
43+
#define SPI_FLASH_SECTOR_PROTECTION false
44+
#else
45+
#define SPI_FLASH_JEDEC_MANUFACTURER_2 0xef
46+
#define SPI_FLASH_SECTOR_PROTECTION_2 false
47+
#endif
48+
#define SPI_FLASH_JEDEC_MEMORY_TYPE 0x40
49+
#define SPI_FLASH_JEDEC_CAPACITY 0x16
50+
51+
#endif // MICROPY_INCLUDED_ATMEL_SAMD_BOARD_FLASH_W25Q32BV_H
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "boards/board.h"
28+
29+
void board_init(void) {
30+
}
31+
32+
bool board_requests_safe_mode(void) {
33+
return false;
34+
}
35+
36+
void reset_board(void) {
37+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/**
2+
* \file
3+
*
4+
* \brief Memory access control configuration file.
5+
*
6+
* Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7+
*
8+
* \asf_license_start
9+
*
10+
* \page License
11+
*
12+
* Redistribution and use in source and binary forms, with or without
13+
* modification, are permitted provided that the following conditions are met:
14+
*
15+
* 1. Redistributions of source code must retain the above copyright notice,
16+
* this list of conditions and the following disclaimer.
17+
*
18+
* 2. Redistributions in binary form must reproduce the above copyright notice,
19+
* this list of conditions and the following disclaimer in the documentation
20+
* and/or other materials provided with the distribution.
21+
*
22+
* 3. The name of Atmel may not be used to endorse or promote products derived
23+
* from this software without specific prior written permission.
24+
*
25+
* 4. This software may only be redistributed and used in connection with an
26+
* Atmel microcontroller product.
27+
*
28+
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31+
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36+
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38+
* POSSIBILITY OF SUCH DAMAGE.
39+
*
40+
* \asf_license_stop
41+
*
42+
*/
43+
/*
44+
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
45+
*/
46+
47+
#ifndef _CONF_ACCESS_H_
48+
#define _CONF_ACCESS_H_
49+
50+
#include "compiler.h"
51+
#include "board.h"
52+
53+
54+
/*! \name Activation of Logical Unit Numbers
55+
*/
56+
//! @{
57+
#define LUN_0 ENABLE //!< On-Chip Virtual Memory.
58+
#define LUN_1 DISABLE //!< AT45DBX Data Flash.
59+
#define LUN_2 DISABLE //!< SD/MMC Card over SPI.
60+
#define LUN_3 DISABLE //!< SD/MMC Card over MCI Slot 0.
61+
#define LUN_4 DISABLE
62+
#define LUN_5 DISABLE
63+
#define LUN_6 DISABLE
64+
#define LUN_7 DISABLE
65+
#define LUN_USB DISABLE //!< Host Mass-Storage Memory.
66+
//! @}
67+
68+
/*! \name LUN 0 Definitions
69+
*/
70+
//! @{
71+
#define LUN_0_INCLUDE "access_vfs.h"
72+
#define Lun_0_test_unit_ready vfs_test_unit_ready
73+
#define Lun_0_read_capacity vfs_read_capacity
74+
#define Lun_0_unload NULL
75+
#define Lun_0_wr_protect vfs_wr_protect
76+
#define Lun_0_removal vfs_removal
77+
#define Lun_0_usb_read_10 vfs_usb_read_10
78+
#define Lun_0_usb_write_10 vfs_usb_write_10
79+
#define LUN_0_NAME "\"CircuitPython VFS[0]\""
80+
//! @}
81+
82+
#define MEM_USB LUN_USB
83+
84+
/*! \name Actions Associated with Memory Accesses
85+
*
86+
* Write here the action to associate with each memory access.
87+
*
88+
* \warning Be careful not to waste time in order not to disturb the functions.
89+
*/
90+
//! @{
91+
#define memory_start_read_action(nb_sectors)
92+
#define memory_stop_read_action()
93+
#define memory_start_write_action(nb_sectors)
94+
#define memory_stop_write_action()
95+
//! @}
96+
97+
/*! \name Activation of Interface Features
98+
*/
99+
//! @{
100+
#define ACCESS_USB true //!< MEM <-> USB interface.
101+
#define ACCESS_MEM_TO_RAM false //!< MEM <-> RAM interface.
102+
#define ACCESS_STREAM false //!< Streaming MEM <-> MEM interface.
103+
#define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode.
104+
#define ACCESS_MEM_TO_MEM false //!< MEM <-> MEM interface.
105+
#define ACCESS_CODEC false //!< Codec interface.
106+
//! @}
107+
108+
/*! \name Specific Options for Access Control
109+
*/
110+
//! @{
111+
#define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
112+
//! @}
113+
114+
115+
#endif // _CONF_ACCESS_H_
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* \file
3+
*
4+
* \brief User board configuration template
5+
*
6+
*/
7+
/*
8+
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
9+
*/
10+
11+
#ifndef CONF_BOARD_H
12+
#define CONF_BOARD_H
13+
14+
#endif // CONF_BOARD_H
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "conf_clocks_crystalless.h"

0 commit comments

Comments
 (0)