⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check.py

📁 This is a software implementation of the USB low-speed protocol for the Atmel ATtiny microcontrolle
💻 PY
字号:
#!/usr/bin/python# ======================================================================# check.py - Check section sizes and other constraints## Copyright 2006-2008 Dick Streefland## This is free software, licensed under the terms of the GNU General# Public License as published by the Free Software Foundation.# ======================================================================import os, sysstacksize = 32flashsize = 2048ramsize   = 128if len(sys.argv) > 2:	stacksize = int(sys.argv[2])if len(sys.argv) > 3:	flashsize = int(sys.argv[3])if len(sys.argv) > 4:	ramsize   = int(sys.argv[4])max_sram = ramsize - stacksizecrc4tab = 0for line in os.popen('avr-objdump -ht ' + sys.argv[1]).readlines():	a = line.split()	if len(a) == 7:		if a[1] == '.text':			text = int(a[2], 16)		if a[1] == '.data':			data = int(a[2], 16)		if a[1] == '.bss':			bss = int(a[2], 16)	if len(a) == 5 and a[4] == 'crc4tab':		crc4tab = int(a[0], 16)print 'text: %d, data: %d, bss: %d' % (text, data, bss)status = 0overflow = text + data - flashsizeif overflow > 0:	print 'ERROR: Flash size limit exceeded by %d bytes.' % overflow	status = 1overflow = bss + data - max_sramif overflow > 0:	print 'ERROR: SRAM size limit exceeded by %d bytes.' % overflow	status = 1if (crc4tab & 0xff) > 0xf0:	print 'ERROR: The table crc4tab should not cross a page boundary.'	status = 1sys.exit(status)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -