├── .gitignore ├── resources ├── python │ └── __init__.py ├── doc │ ├── footer.html │ ├── header.html │ ├── jquery.smartmenus.bootstrap.css │ ├── jquery.smartmenus.bootstrap.js │ ├── customdoxygen.css │ ├── doxy-boot.js │ └── jquery.smartmenus.js └── patches │ └── slac460y.fixes.patch ├── ebs ├── swig-python.cmake ├── graphics.cmake ├── exe-conf.cmake ├── lib-doc.cmake ├── lib-conf.cmake └── driver-conf.cmake ├── Platform ├── common.cmake ├── avr-gcc.cmake └── msp430-gcc.cmake ├── toolchain-avr-gcc.cmake ├── toolchain-msp430-gcc-ti.cmake ├── propeller-gcc.md └── msp430-gcc-ti.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | packages 3 | *.kdev4 4 | *.kate-swp 5 | -------------------------------------------------------------------------------- /resources/python/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 3 | -------------------------------------------------------------------------------- /resources/doc/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ebs/swig-python.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | FIND_PACKAGE(SWIG REQUIRED) 4 | INCLUDE(${SWIG_USE_FILE}) 5 | 6 | FIND_PACKAGE(PythonInterp REQUIRED) 7 | FIND_PACKAGE(PythonLibs REQUIRED) 8 | INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) 9 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 10 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSWIG") 11 | SET(CMAKE_SWIG_FLAGS "") 12 | SWIG_ADD_LIBRARY(${LIBRARY_NAME} LANGUAGE python SOURCES ${SWIG_SOURCES}) 13 | SWIG_LINK_LIBRARIES(${LIBRARY_NAME} ${PYTHON_LIBRARIES}) 14 | 15 | # Install PYTHON bindings 16 | EXECUTE_PROCESS(COMMAND python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" 17 | OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) 18 | INSTALL(TARGETS _${LIBRARY_NAME} DESTINATION ${PYTHON_SITE_PACKAGES}/ebs) 19 | INSTALL(FILES ${TOOLCHAINS_PATH}/resources/python/__init__.py DESTINATION ${PYTHON_SITE_PACKAGES}/ebs) 20 | INSTALL(FILES ${CMAKE_BINARY_DIR}/${LIBRARY_NAME}.py DESTINATION ${PYTHON_SITE_PACKAGES}/ebs) 21 | -------------------------------------------------------------------------------- /ebs/graphics.cmake: -------------------------------------------------------------------------------- 1 | 2 | MACRO(add_image VAR SOURCE FORMAT BPP ENCODING PIXELTYPE) 3 | 4 | GET_FILENAME_COMPONENT(IMAGE_NAME ${SOURCE} NAME_WE) 5 | GET_FILENAME_COMPONENT(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) 6 | FILE(RELATIVE_PATH INCLUDE_PREFIX ${CMAKE_SOURCE_DIR} ${PARENT_DIR}) 7 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/${INCLUDE_PREFIX}) 8 | 9 | SET(CONVERT_ARGS "") 10 | 11 | IF(NOT ${ENCODING} STREQUAL "") 12 | SET(CONVERT_ARGS ${CONVERT_ARGS} -e ${ENCODING}) 13 | ENDIF() 14 | 15 | SET(EXTRA_ARGS ${ARGN}) 16 | LIST(LENGTH EXTRA_ARGS NUM_EXTRA_ARGS) 17 | IF(NUM_EXTRA_ARGS GREATER 0) 18 | SET(CONVERT_ARGS ${CONVERT_ARGS} -x ${ARGV6}) 19 | ENDIF() 20 | IF(NUM_EXTRA_ARGS GREATER 1) 21 | SET(CONVERT_ARGS ${CONVERT_ARGS} -y ${ARGV7}) 22 | ENDIF() 23 | 24 | ADD_CUSTOM_COMMAND( 25 | COMMAND convert-image ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} 26 | -o ${CMAKE_CURRENT_BINARY_DIR} --format ${FORMAT} 27 | --incdir ${BUILD_INCLUDE_DIR} ${CONVERT_ARGS} 28 | DEPENDS ${SOURCE} 29 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_NAME}.c 30 | ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_NAME}.h 31 | ${BUILD_INCLUDE_DIR}/${IMAGE_NAME}.h 32 | COMMENT "Generating code for ${IMAGE_NAME}." 33 | ) 34 | MESSAGE("Image : ${IMAGE_NAME} ${FORMAT} ${ENCODING}") 35 | SET(${VAR} ${${VAR}} ${IMAGE_NAME}.c) 36 | 37 | ENDMACRO() 38 | -------------------------------------------------------------------------------- /ebs/exe-conf.cmake: -------------------------------------------------------------------------------- 1 | 2 | MACRO(SUBDIRPATHS result curdir) 3 | FILE(GLOB children ${curdir}/*) 4 | SET(dirlist "") 5 | FOREACH(child ${children}) 6 | IF(IS_DIRECTORY ${child}) 7 | LIST(APPEND dirlist ${child}) 8 | ENDIF(IS_DIRECTORY ${child}) 9 | ENDFOREACH(child ${children}) 10 | SET(${result} ${dirlist}) 11 | ENDMACRO(SUBDIRPATHS) 12 | 13 | SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${PROJECT_VERSION_TWEAK}") 14 | 15 | MESSAGE("Firmware : ${PROJECT_NAME}") 16 | MESSAGE("Version : ${PROJECT_VERSION}") 17 | 18 | IF(${USE_ASM_IF_AVAILABLE}) 19 | ENABLE_LANGUAGE(ASM) 20 | ENDIF() 21 | 22 | SET(BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") 23 | SET(CMAKE_INSTALL_PREFIX ${PLATFORM_PACKAGES_PATH}) 24 | SET(PUBLIC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 25 | 26 | FILE(MAKE_DIRECTORY "${BUILD_INCLUDE_DIR}/drivers") 27 | FILE(MAKE_DIRECTORY "${BUILD_INCLUDE_DIR}/sys") 28 | 29 | CONFIGURE_FILE( 30 | "${CMAKE_CURRENT_SOURCE_DIR}/app/config.h.in" 31 | "${BUILD_INCLUDE_DIR}/app/config.h" 32 | ) 33 | INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 34 | 35 | IF(EXISTS "${CMAKE_SOURCE_DIR}/asp/bsp/uc/uc.ld") 36 | SET(EXTRA_LINKER_FLAGS "-T ${CMAKE_SOURCE_DIR}/asp/bsp/uc/uc.ld") 37 | ENDIF() 38 | 39 | SUBDIRPATHS(SPATHS "${CMAKE_SOURCE_DIR}/asp") 40 | INCLUDE_DIRECTORIES(${SPATHS} ${INCLUDE_DIRECTORIES}) 41 | ADD_SUBDIRECTORY(asp) 42 | ADD_SUBDIRECTORY(hal) 43 | 44 | ADD_SUBDIRECTORY(sys) 45 | ADD_SUBDIRECTORY(app) 46 | 47 | ADD_SUBDIRECTORY(doc) 48 | ADD_SUBDIRECTORY(resources) 49 | 50 | -------------------------------------------------------------------------------- /ebs/lib-doc.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | FIND_PACKAGE(Doxygen) 4 | 5 | IF(DOXYGEN_FOUND) 6 | SET(TMP_PP_INCL_DIRS) 7 | GET_PROPERTY(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) 8 | FOREACH(dir ${dirs}) 9 | SET(TMP_PP_INCL_DIRS "${TMP_PP_INCL_DIRS} ${dir}") 10 | ENDFOREACH(dir ${dirs}) 11 | SET(DOXYGEN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc") 12 | 13 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 14 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) 15 | 16 | ADD_CUSTOM_TARGET(doc-build ${DOXYGEN_EXECUTABLE} 17 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 18 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 19 | COMMENT "Generating documentation with Doxygen" VERBATIM) 20 | 21 | # ADD_CUSTOM_TARGET(doc-pdf make 22 | # WORKING_DIRECTORY ${DOXYGEN_OUTPUT_DIR}/latex 23 | # COMMENT "Generating documentation PDF from Latex" VERBATIM 24 | # DEPENDS doc-build) 25 | 26 | ADD_CUSTOM_TARGET(doc COMMENT "Generating Documenation" VERBATIM 27 | DEPENDS doc-build) 28 | 29 | SET(DOC_HTML_TARGET "ebs:~/www/doc/${CMAKE_PROJECT_NAME}") 30 | SET(DOC_HTML_URL "http://ebs.chintal.in/doc/${CMAKE_PROJECT_NAME}") 31 | ADD_CUSTOM_TARGET(doc-install 32 | rsync -avzh --partial --info=progress2 --delete -e ssh 33 | ${DOXYGEN_OUTPUT_DIR}/html/ ${DOC_HTML_TARGET} 34 | WORKING_DIRECTORY ${DOXYGEN_OUTPUT_DIR} 35 | COMMENT "Publishing Doxygen HTML" VERBATIM 36 | DEPENDS doc) 37 | 38 | ADD_CUSTOM_COMMAND(TARGET doc-install POST_BUILD 39 | COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan 40 | "Published Doc HTML to ${DOC_HTML_URL}") 41 | 42 | ENDIF(DOXYGEN_FOUND) 43 | 44 | -------------------------------------------------------------------------------- /ebs/lib-conf.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${PROJECT_VERSION_TWEAK}") 4 | 5 | 6 | IF(CMAKE_TOOLCHAIN_FILE) 7 | # This is a cross-platform build, and therefore is assumed to be intended for an 8 | # embedded target 9 | IF(${USE_ASM_IF_AVAILABLE}) 10 | ENABLE_LANGUAGE(ASM) 11 | ENDIF() 12 | SET(CMAKE_INSTALL_PREFIX ${PLATFORM_PACKAGES_PATH}) 13 | SET(PUBLIC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 14 | IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) 15 | # This is library only build. 16 | MESSAGE("Library : ${PROJECT_NAME} ${PROJECT_VERSION}") 17 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) 18 | CONFIGURE_FILE( 19 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 20 | "${BUILD_INCLUDE_DIR}/config.h" 21 | ) 22 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 23 | INSTALL(FILES "${BUILD_INCLUDE_DIR}/config.h" DESTINATION include/${LIBRARY_NAME}) 24 | ELSE() 25 | # This is a firmware integrated build. Ensure the library headers and generated config file ends up in 26 | # the firmware include tree. Lib include folder is symlinked from the src directory. This is messy, 27 | # possibly rickety, probably needs to have a better solution, but for the moment it works. 28 | MESSAGE("Integrated Library : ${PROJECT_NAME} ${PROJECT_VERSION}") 29 | GET_FILENAME_COMPONENT(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) 30 | FILE(RELATIVE_PATH INCLUDE_PREFIX ${CMAKE_SOURCE_DIR} ${PARENT_DIR}) 31 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/${INCLUDE_PREFIX}) 32 | EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PUBLIC_INCLUDE_DIRECTORY} ${BUILD_INCLUDE_DIR}) 33 | CONFIGURE_FILE( 34 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 35 | "${BUILD_INCLUDE_DIR}/config.h" 36 | ) 37 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 38 | ENDIF() 39 | ELSE(CMAKE_TOOLCHAIN_FILE) 40 | MESSAGE("Host Library : ${PROJECT_NAME} ${PROJECT_VERSION}") 41 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) 42 | CONFIGURE_FILE( 43 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 44 | "${BUILD_INCLUDE_DIR}/config.h" 45 | ) 46 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 47 | ENDIF(CMAKE_TOOLCHAIN_FILE) 48 | 49 | -------------------------------------------------------------------------------- /Platform/common.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Helper macro for LIST_REPLACE 4 | macro(LIST_REPLACE LISTV OLDVALUE NEWVALUE) 5 | LIST(FIND ${LISTV} ${OLDVALUE} INDEX) 6 | LIST(INSERT ${LISTV} ${INDEX} ${NEWVALUE}) 7 | MATH(EXPR __INDEX "${INDEX} + 1") 8 | LIST(REMOVE_AT ${LISTV} ${__INDEX}) 9 | endmacro(LIST_REPLACE) 10 | 11 | MACRO(install_file_tree LOCATION) 12 | FOREACH(ifile ${ARGN}) 13 | IF(NOT IS_ABSOLUTE ${ifile}) 14 | GET_FILENAME_COMPONENT(ifile ${ifile} ABSOLUTE 15 | BASE_DIR ${CMAKE_SOURCE_DIR}) 16 | ENDIF() 17 | FILE(RELATIVE_PATH rel ${PUBLIC_INCLUDE_DIRECTORY} ${ifile}) 18 | GET_FILENAME_COMPONENT( dir ${rel} DIRECTORY ) 19 | INSTALL(FILES ${ifile} DESTINATION ${LOCATION}/${dir}) 20 | ENDFOREACH(ifile) 21 | ENDMACRO(install_file_tree) 22 | 23 | MACRO(install_platform_library LIBRARY_NAME) 24 | FOREACH(device ${SUPPORTED_DEVICES}) 25 | INSTALL(TARGETS ${LIBRARY_NAME}-${device} DESTINATION lib EXPORT ${LIBRARY_NAME}-config) 26 | IF (PUBLIC_INCLUDE_DIRECTORY) 27 | TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME}-${device} PUBLIC 28 | ${PLATFORM_PACKAGES_PATH}/include/${LIBRARY_NAME}) 29 | ENDIF (PUBLIC_INCLUDE_DIRECTORY) 30 | ENDFOREACH(device) 31 | IF (PUBLIC_INCLUDE_DIRECTORY) 32 | INSTALL_FILE_TREE(include/${LIBRARY_NAME} ${ARGN}) 33 | ENDIF (PUBLIC_INCLUDE_DIRECTORY) 34 | INSTALL(EXPORT ${LIBRARY_NAME}-config DESTINATION lib/cmake/${LIBRARY_NAME}) 35 | ENDMACRO(install_platform_library) 36 | 37 | MACRO(FALLBACK_DEFAULT VAR DEFAULT) 38 | IF(NOT DEFINED ${VAR}) 39 | SET(${VAR} ${DEFAULT}) 40 | ENDIF() 41 | ENDMACRO() 42 | 43 | MACRO(ADD_FILES VAR) 44 | FILE(RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") 45 | FOREACH(_file ${ARGN}) 46 | IF("${VAR}" STREQUAL "SOURCES") 47 | IF(${USE_ASM_IF_AVAILABLE}) 48 | GET_FILENAME_COMPONENT(_name ${_file} NAME_WE) 49 | IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}-${TOOLCHAIN_PREFIX}.S") 50 | SET(_file ${_name}-${TOOLCHAIN_PREFIX}.S) 51 | ENDIF() 52 | ENDIF() 53 | ENDIF() 54 | IF(_relPath) 55 | SET(_file "${_relPath}/${_file}") 56 | ENDIF() 57 | SET(${VAR} ${${VAR}} ${_file}) 58 | ENDFOREACH() 59 | IF(_relPath) 60 | # propagate SRCS to parent directory 61 | SET(${VAR} ${${VAR}} PARENT_SCOPE) 62 | ENDIF() 63 | ENDMACRO() 64 | -------------------------------------------------------------------------------- /ebs/driver-conf.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${PROJECT_VERSION_TWEAK}") 4 | 5 | 6 | IF(CMAKE_TOOLCHAIN_FILE) 7 | # This is a cross-platform build, and therefore is assumed to be intended for an 8 | # embedded target 9 | IF(${USE_ASM_IF_AVAILABLE}) 10 | ENABLE_LANGUAGE(ASM) 11 | ENDIF() 12 | SET(CMAKE_INSTALL_PREFIX ${PLATFORM_PACKAGES_PATH}) 13 | SET(PUBLIC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 14 | IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) 15 | # This is library only build. 16 | MESSAGE("Driver : ${PROJECT_NAME} ${PROJECT_VERSION}") 17 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) 18 | CONFIGURE_FILE( 19 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 20 | "${BUILD_INCLUDE_DIR}/config.h" 21 | ) 22 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 23 | INSTALL(FILES "${BUILD_INCLUDE_DIR}/config.h" DESTINATION include/${LIBRARY_NAME}) 24 | ELSE() 25 | # This is a firmware integrated build. Ensure the library headers and generated config file ends up in 26 | # the firmware include tree. Lib include folder is symlinked from the src directory. This is messy, 27 | # possibly rickety, probably needs to have a better solution, but for the moment it works. 28 | MESSAGE("Integrated Driver : ${PROJECT_NAME} ${PROJECT_VERSION}") 29 | GET_FILENAME_COMPONENT(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) 30 | GET_FILENAME_COMPONENT(DRIVER_NAME ${PARENT_DIR} NAME) 31 | SET(INCLUDE_PREFIX "drivers/${DRIVER_NAME}") 32 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/${INCLUDE_PREFIX}) 33 | EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PUBLIC_INCLUDE_DIRECTORY} ${BUILD_INCLUDE_DIR}) 34 | CONFIGURE_FILE( 35 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 36 | "${BUILD_INCLUDE_DIR}/config.h" 37 | ) 38 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 39 | ENDIF() 40 | ELSE(CMAKE_TOOLCHAIN_FILE) 41 | MESSAGE("Host Library : ${PROJECT_NAME} ${PROJECT_VERSION}") 42 | SET(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) 43 | CONFIGURE_FILE( 44 | "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" 45 | "${BUILD_INCLUDE_DIR}/config.h" 46 | ) 47 | INCLUDE_DIRECTORIES(${BUILD_INCLUDE_DIR} ${INCLUDE_DIRECTORIES}) 48 | ENDIF(CMAKE_TOOLCHAIN_FILE) 49 | 50 | -------------------------------------------------------------------------------- /resources/doc/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | $projectname: $title 15 | $title 16 | 17 | 18 | $treeview 19 | $search 20 | $mathjax 21 | 22 | $extrastylesheet 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 41 |
42 |
43 |
44 |
45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /resources/doc/jquery.smartmenus.bootstrap.css: -------------------------------------------------------------------------------- 1 | /* 2 | You probably do not need to edit this at all. 3 | 4 | Add some SmartMenus required styles not covered in Bootstrap 3's default CSS. 5 | These are theme independent and should work with any Bootstrap 3 theme mod. 6 | */ 7 | /* sub menus arrows on desktop */ 8 | .navbar-nav:not(.sm-collapsible) ul .caret { 9 | position: absolute; 10 | right: 0; 11 | margin-top: 6px; 12 | margin-right: 15px; 13 | border-top: 4px solid transparent; 14 | border-bottom: 4px solid transparent; 15 | border-left: 4px dashed; 16 | } 17 | .navbar-nav:not(.sm-collapsible) ul a.has-submenu { 18 | padding-right: 30px; 19 | } 20 | /* make sub menu arrows look like +/- buttons in collapsible mode */ 21 | .navbar-nav.sm-collapsible .caret, .navbar-nav.sm-collapsible ul .caret { 22 | position: absolute; 23 | right: 0; 24 | margin: -3px 15px 0 0; 25 | padding: 0; 26 | width: 32px; 27 | height: 26px; 28 | line-height: 24px; 29 | text-align: center; 30 | border-width: 1px; 31 | border-style: solid; 32 | } 33 | .navbar-nav.sm-collapsible .caret:before { 34 | content: '+'; 35 | font-family: monospace; 36 | font-weight: bold; 37 | } 38 | .navbar-nav.sm-collapsible .open > a > .caret:before { 39 | content: '-'; 40 | } 41 | .navbar-nav.sm-collapsible a.has-submenu { 42 | padding-right: 50px; 43 | } 44 | /* revert to Bootstrap's default carets in collapsible mode when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav */ 45 | .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret, .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] ul .caret { 46 | position: static; 47 | margin: 0 0 0 2px; 48 | padding: 0; 49 | width: 0; 50 | height: 0; 51 | border-top: 4px dashed; 52 | border-right: 4px solid transparent; 53 | border-bottom: 0; 54 | border-left: 4px solid transparent; 55 | } 56 | .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret:before { 57 | content: '' !important; 58 | } 59 | .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] a.has-submenu { 60 | padding-right: 15px; 61 | } 62 | /* scrolling arrows for tall menus */ 63 | .navbar-nav span.scroll-up, .navbar-nav span.scroll-down { 64 | position: absolute; 65 | display: none; 66 | visibility: hidden; 67 | height: 20px; 68 | overflow: hidden; 69 | text-align: center; 70 | } 71 | .navbar-nav span.scroll-up-arrow, .navbar-nav span.scroll-down-arrow { 72 | position: absolute; 73 | top: -2px; 74 | left: 50%; 75 | margin-left: -8px; 76 | width: 0; 77 | height: 0; 78 | overflow: hidden; 79 | border-top: 7px dashed transparent; 80 | border-right: 7px dashed transparent; 81 | border-bottom: 7px solid; 82 | border-left: 7px dashed transparent; 83 | } 84 | .navbar-nav span.scroll-down-arrow { 85 | top: 6px; 86 | border-top: 7px solid; 87 | border-right: 7px dashed transparent; 88 | border-bottom: 7px dashed transparent; 89 | border-left: 7px dashed transparent; 90 | } 91 | /* add more indentation for 2+ level sub in collapsible mode - Bootstrap normally supports just 1 level sub menus */ 92 | .navbar-nav.sm-collapsible ul .dropdown-menu > li > a, 93 | .navbar-nav.sm-collapsible ul .dropdown-menu .dropdown-header { 94 | padding-left: 35px; 95 | } 96 | .navbar-nav.sm-collapsible ul ul .dropdown-menu > li > a, 97 | .navbar-nav.sm-collapsible ul ul .dropdown-menu .dropdown-header { 98 | padding-left: 45px; 99 | } 100 | .navbar-nav.sm-collapsible ul ul ul .dropdown-menu > li > a, 101 | .navbar-nav.sm-collapsible ul ul ul .dropdown-menu .dropdown-header { 102 | padding-left: 55px; 103 | } 104 | .navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu > li > a, 105 | .navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu .dropdown-header { 106 | padding-left: 65px; 107 | } 108 | /* fix SmartMenus sub menus auto width (subMenusMinWidth and subMenusMaxWidth options) */ 109 | .navbar-nav .dropdown-menu > li > a { 110 | white-space: normal; 111 | } 112 | .navbar-nav ul.sm-nowrap > li > a { 113 | white-space: nowrap; 114 | } 115 | .navbar-nav.sm-collapsible ul.sm-nowrap > li > a { 116 | white-space: normal; 117 | } 118 | /* fix .navbar-right subs alignment */ 119 | .navbar-right ul.dropdown-menu { 120 | left: 0; 121 | right: auto; 122 | } -------------------------------------------------------------------------------- /toolchain-avr-gcc.cmake: -------------------------------------------------------------------------------- 1 | # To be able to use Force Compiler macros. 2 | include(CMakeForceCompiler) 3 | 4 | # Add the location of your "toolchains" folder to the module path 5 | SET(TOOLCHAINS_PATH "/home/chintal/code/toolchains") 6 | LIST(APPEND CMAKE_MODULE_PATH ${TOOLCHAINS_PATH}) 7 | SET(PLATFORM_PACKAGES_PATH "${TOOLCHAINS_PATH}/packages/avr") 8 | LIST(APPEND CMAKE_MODULE_PATH "${PLATFORM_PACKAGES_PATH}/lib/cmake") 9 | LIST(APPEND CMAKE_PREFIX_PATH "${PLATFORM_PACKAGES_PATH}/lib/cmake") 10 | INCLUDE_DIRECTORIES("${PLATFORM_PACKAGES_PATH}/include ${INCLUDE_DIRECTORIES}") 11 | 12 | SET(SUPPORTED_DEVICES "atmega16;atmega32;atmega644;atmega48;atmega88;atmega168;atmega328" 13 | CACHE STRING "Supported Target Devices") 14 | 15 | # Name should be 'Generic' or something for which a 16 | # Platform/.cmake (or other derivatives thereof, see cmake docs) 17 | # file exists. The cmake installation comes with a Platform folder with 18 | # defined platforms, and we add our custom ones to the "Platform" folder 19 | # within the "toolchain" folder. 20 | set(CMAKE_SYSTEM_NAME avr-gcc) 21 | 22 | # Compiler and related toochain configuration 23 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | 25 | SET(AVR_LIBC_FOLDER /usr/lib/avr) 26 | SET(AVR_INCLUDE_FOLDER ${AVR_LIBC_FOLDER}/include) 27 | SET(TOOLCHAIN_PREFIX avr) 28 | 29 | INCLUDE_DIRECTORIES(${AVR_INCLUDE_FOLDER} ${INCLUDE_DIRECTORIES}) 30 | 31 | # This can be skipped to directly set paths below, or augmented with hints 32 | # and such. See cmake docs of FIND_PROGRAM for details. 33 | FIND_PROGRAM(AVR_CC ${TOOLCHAIN_PREFIX}-gcc) 34 | FIND_PROGRAM(AVR_CXX ${TOOLCHAIN_PREFIX}-g++) 35 | FIND_PROGRAM(AVR_AR ${TOOLCHAIN_PREFIX}-ar) 36 | FIND_PROGRAM(AVR_AS ${TOOLCHAIN_PREFIX}-as) 37 | FIND_PROGRAM(AVR_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump) 38 | FIND_PROGRAM(AVR_OBJCOPY ${TOOLCHAIN_PREFIX}-objcopy) 39 | FIND_PROGRAM(AVR_SIZE ${TOOLCHAIN_PREFIX}-size) 40 | FIND_PROGRAM(AVR_NM ${TOOLCHAIN_PREFIX}-nm) 41 | FIND_PROGRAM(AVR_DUDE avrdude) 42 | 43 | # Since the compiler needs an -mmcu flag to do anything, checks need to be bypassed 44 | SET(CMAKE_C_COMPILER ${AVR_CC} CACHE STRING "C Compiler") 45 | SET(CMAKE_CXX_COMPILER ${AVR_CXX} CACHE STRING "C++ Compiler") 46 | 47 | SET(AS ${AVR_AS} CACHE STRING "AS Binary") 48 | SET(AR ${AVR_AR} CACHE STRING "AR Binary") 49 | SET(OBJCOPY ${AVR_OBJCOPY} CACHE STRING "OBJCOPY Binary") 50 | SET(OBJDUMP ${AVR_OBJDUMP} CACHE STRING "OBJDUMP Binary") 51 | SET(SIZE ${AVR_SIZE} CACHE STRING "SIZE Binary") 52 | 53 | IF(NOT CMAKE_BUILD_TYPE) 54 | SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING 55 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." 56 | FORCE) 57 | ENDIF(NOT CMAKE_BUILD_TYPE) 58 | 59 | SET(AVR_OPT_LEVEL "0" 60 | CACHE STRING "Optimization Level") 61 | 62 | SET(AVR_WARN_PROFILE "-Wall -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused" 63 | CACHE STRING "AVR GCC Warnings") 64 | 65 | SET(AVR_DISABLED_BUILTINS "-fno-builtin-printf -fno-builtin-sprintf" 66 | CACHE STRING "AVR GCC Disabled Builtins") 67 | 68 | SET(AVR_OPTIONS "-g -fdata-sections -ffunction-sections -fverbose-asm -std=gnu11 ${AVR_DISABLED_BUILTINS}" 69 | CACHE STRING "AVR GCC OPTIONS") 70 | 71 | SET(CMAKE_C_FLAGS "${AVR_WARN_PROFILE} ${AVR_OPTIONS} -O${AVR_OPT_LEVEL} -DGCC_AVR" 72 | CACHE STRING "AVR GCC C Flags") 73 | 74 | SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--gc-sections -Wl,--print-gc-sections" 75 | CACHE STRING "Linker Flags") 76 | 77 | SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections" 78 | CACHE STRING "Linker Flags") 79 | 80 | # Specify linker command. This is needed to use gcc as linker instead of ld 81 | # This seems to be the preferred way for MSPGCC atleast, seemingly to avoid 82 | # linking against stdlib. 83 | set(CMAKE_CXX_LINK_EXECUTABLE 84 | " ${CMAKE_EXE_LINKER_FLAGS} -o " 85 | CACHE STRING "C++ Executable Link Command") 86 | 87 | set(CMAKE_C_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE} 88 | CACHE STRING "C Executable Link Command") 89 | 90 | # Programmer and related toochain configuration 91 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 | 93 | set(PROGBIN ${AVR_DUDE} CACHE STRING "Programmer Application") 94 | set(PROGRAMMER tilib CACHE STRING "Programmer driver") 95 | -------------------------------------------------------------------------------- /toolchain-msp430-gcc-ti.cmake: -------------------------------------------------------------------------------- 1 | # To be able to use Force Compiler macros. 2 | include(CMakeForceCompiler) 3 | 4 | # Add the location of your "toolchains" folder to the module path. 5 | SET(TOOLCHAINS_PATH "/home/chintal/code/toolchains") 6 | LIST(APPEND CMAKE_MODULE_PATH ${TOOLCHAINS_PATH}) 7 | SET(PLATFORM_PACKAGES_PATH "${TOOLCHAINS_PATH}/packages/msp430") 8 | LIST(APPEND CMAKE_MODULE_PATH "${PLATFORM_PACKAGES_PATH}/lib/cmake") 9 | LIST(APPEND CMAKE_PREFIX_PATH "${PLATFORM_PACKAGES_PATH}/lib/cmake") 10 | INCLUDE_DIRECTORIES("${PLATFORM_PACKAGES_PATH}/include ${INCLUDE_DIRECTORIES}") 11 | 12 | SET(SUPPORTED_DEVICES "msp430f5529;msp430f5521" 13 | #SET(SUPPORTED_DEVICES "msp430fr5969;msp430fr5959" 14 | CACHE STRING "Supported Target Devices") 15 | 16 | # Name should be 'Generic' or something for which a 17 | # Platform/.cmake (or other derivatives thereof, see cmake docs) 18 | # file exists. The cmake installation comes with a Platform folder with 19 | # defined platforms, and we add our custom ones to the "Platform" folder 20 | # within the "toolchain" folder. 21 | set(CMAKE_SYSTEM_NAME msp430-gcc) 22 | 23 | # Compiler and related toochain configuration 24 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | 26 | SET(MSP430_TI_COMPILER_FOLDER /opt/ti/msp430/gcc) 27 | SET(MSP430_TI_BIN_FOLDER ${MSP430_TI_COMPILER_FOLDER}/bin) 28 | SET(MSP430_TI_INCLUDE_FOLDER ${MSP430_TI_COMPILER_FOLDER}/include) 29 | SET(TOOLCHAIN_PREFIX msp430-elf) 30 | SET(TOOLCHAIN_BIN_PATH ${MSP430_TI_BIN_FOLDER}) 31 | 32 | INCLUDE_DIRECTORIES(${MSP430_TI_INCLUDE_FOLDER} ${INCLUDE_DIRECTORIES}) 33 | LINK_DIRECTORIES( ${MSP430_TI_INCLUDE_FOLDER} ${LINK_DIRECTORIES}) 34 | 35 | # This can be skipped to directly set paths below, or augmented with hints 36 | # and such. See cmake docs of FIND_PROGRAM for details. 37 | FIND_PROGRAM(MSP430_CC ${TOOLCHAIN_PREFIX}-gcc 38 | PATHS ${TOOLCHAIN_BIN_PATH}) 39 | FIND_PROGRAM(MSP430_CXX ${TOOLCHAIN_PREFIX}-g++ 40 | PATHS ${TOOLCHAIN_BIN_PATH}) 41 | FIND_PROGRAM(MSP430_AR ${TOOLCHAIN_PREFIX}-ar 42 | PATHS ${TOOLCHAIN_BIN_PATH}) 43 | FIND_PROGRAM(MSP430_AS ${TOOLCHAIN_PREFIX}-as 44 | PATHS ${TOOLCHAIN_BIN_PATH}) 45 | FIND_PROGRAM(MSP430_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump 46 | PATHS ${TOOLCHAIN_BIN_PATH}) 47 | FIND_PROGRAM(MSP430_OBJCOPY ${TOOLCHAIN_PREFIX}-objcopy 48 | PATHS ${TOOLCHAIN_BIN_PATH}) 49 | FIND_PROGRAM(MSP430_SIZE ${TOOLCHAIN_PREFIX}-size 50 | PATHS ${TOOLCHAIN_BIN_PATH}) 51 | FIND_PROGRAM(MSP430_NM ${TOOLCHAIN_PREFIX}-nm 52 | PATHS ${TOOLCHAIN_BIN_PATH}) 53 | FIND_PROGRAM(MSP430_MSPDEBUG mspdebug) 54 | 55 | # Since the compiler needs an -mmcu flag to do anything, checks need to be bypassed 56 | set(CMAKE_C_COMPILER ${MSP430_CC} CACHE STRING "C Compiler") 57 | set(CMAKE_CXX_COMPILER ${MSP430_CXX} CACHE STRING "C++ Compiler") 58 | 59 | set(AS ${MSP430_AS} CACHE STRING "AS Binary") 60 | set(AR ${MSP430_AR} CACHE STRING "AR Binary") 61 | set(OBJCOPY ${MSP430_OBJCOPY} CACHE STRING "OBJCOPY Binary") 62 | set(OBJDUMP ${MSP430_OBJDUMP} CACHE STRING "OBJDUMP Binary") 63 | set(SIZE ${MSP430_SIZE} CACHE STRING "SIZE Binary") 64 | 65 | IF(NOT CMAKE_BUILD_TYPE) 66 | SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING 67 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." 68 | FORCE) 69 | ENDIF(NOT CMAKE_BUILD_TYPE) 70 | 71 | set(MSPGCC_WARN_PROFILE "-Wall -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused" 72 | CACHE STRING "Warnings") 73 | 74 | set(MSPGCC_DISABLED_BUILTINS "-fno-builtin-printf -fno-builtin-sprintf" 75 | CACHE STRING "Disabled Builtins") 76 | 77 | set(MSPGCC_OPTIONS "-g -fdata-sections -ffunction-sections -fverbose-asm ${MSPGCC_DISABLED_BUILTINS}" 78 | CACHE STRING "Compile Options") 79 | 80 | 81 | set(CMAKE_C_FLAGS "${MSPGCC_WARN_PROFILE} ${MSPGCC_OPTIONS} -DGCC_MSP430" 82 | CACHE STRING "C Flags") 83 | 84 | set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--gc-sections -Wl,--print-gc-sections" 85 | CACHE STRING "Shared Library Linker Flags") 86 | 87 | set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections" 88 | CACHE STRING "Executable Linker Flags") 89 | 90 | # Specify linker command. This is needed to use gcc as linker instead of ld 91 | # This seems to be the preferred way for MSPGCC atleast, seemingly to avoid 92 | # linking against stdlib. 93 | set(CMAKE_CXX_LINK_EXECUTABLE 94 | " ${CMAKE_EXE_LINKER_FLAGS} -o " 95 | CACHE STRING "C++ Executable Link Command") 96 | 97 | set(CMAKE_C_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE} 98 | CACHE STRING "C Executable Link Command") 99 | 100 | # Programmer and related toochain configuration 101 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 102 | 103 | set(PROGBIN ${MSP430_MSPDEBUG} CACHE STRING "Programmer Application") 104 | set(PROGRAMMER tilib CACHE STRING "Programmer driver") 105 | -------------------------------------------------------------------------------- /Platform/avr-gcc.cmake: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE("${TOOLCHAINS_PATH}/Platform/common.cmake") 3 | 4 | 5 | # Wrapper around ADD_EXECUTABLE, which adds the necessary -mmcu flags and 6 | # sets up builds for multiple devices. Also creates targets to generate 7 | # disassembly listings, size outputs, map files, and to upload to device. 8 | # Also adds all these extra files created including map files to the clean 9 | # list. 10 | FUNCTION(add_platform_executable EXECUTABLE_NAME DEPENDENCIES) 11 | SET(DEVICES ${SUPPORTED_DEVICES}) 12 | 13 | SET(EXE_NAME ${EXECUTABLE_NAME}) 14 | LIST(REMOVE_AT ARGV 0) 15 | 16 | SET(DEPS ${DEPENDENCIES}) 17 | SEPARATE_ARGUMENTS(DEPS) 18 | LIST(REMOVE_AT ARGV 0) 19 | 20 | FOREACH(device ${DEVICES}) 21 | 22 | SET(ELF_FILE ${EXE_NAME}-${device}.elf) 23 | SET(MAP_FILE ${EXE_NAME}-${device}.map) 24 | SET(LST_FILE ${EXE_NAME}-${device}.lst) 25 | SET(SYM_FILE ${EXE_NAME}-${device}.sym) 26 | 27 | ADD_EXECUTABLE(${ELF_FILE} ${ARGN}) 28 | SET_TARGET_PROPERTIES( 29 | ${ELF_FILE} PROPERTIES 30 | COMPILE_FLAGS "-mmcu=${device}" 31 | LINK_FLAGS "-mmcu=${device} -Wl,-Map,${MAP_FILE} ${EXTRA_LINKER_FLAGS}" 32 | ) 33 | 34 | SET(DDEPS ${DEPS}) 35 | 36 | IF(DDEPS) 37 | LIST(REMOVE_DUPLICATES DDEPS) 38 | FOREACH(dep ${DDEPS}) 39 | LIST_REPLACE(DDEPS "${dep}" "${dep}-${device}") 40 | ENDFOREACH(dep) 41 | TARGET_LINK_LIBRARIES(${ELF_FILE} ${DDEPS}) 42 | ENDIF(DDEPS) 43 | 44 | ADD_CUSTOM_TARGET( 45 | ${EXE_NAME}-${device}.lst ALL 46 | ${AVR_OBJDUMP} -h -S ${ELF_FILE} > ${LST_FILE} 47 | DEPENDS ${ELF_FILE} 48 | ) 49 | 50 | ADD_CUSTOM_TARGET( 51 | ${EXE_NAME}-${device}-size ALL 52 | ${AVR_SIZE} ${ELF_FILE} 53 | DEPENDS ${ELF_FILE} 54 | ) 55 | 56 | ADD_CUSTOM_TARGET( 57 | ${EXE_NAME}-${device}.sym ALL 58 | ${AVR_NM} -l -a -S -s --size-sort ${ELF_FILE} > ${SYM_FILE} 59 | DEPENDS ${ELF_FILE} 60 | ) 61 | 62 | ADD_CUSTOM_TARGET( 63 | ${EXE_NAME}-${device}-upload 64 | # TODO This needs to be better structured to allow 65 | # programmer change 66 | ${PROGBIN} -n ${PROGRAMMER} \"prog ${ELF_FILE}\" --allow-fw-update 67 | DEPENDS ${ELF_FILE} 68 | ) 69 | 70 | LIST(APPEND all_lst_files ${LST_FILE}) 71 | LIST(APPEND all_elf_files ${ELF_FILE}) 72 | LIST(APPEND all_map_files ${MAP_FILE}) 73 | LIST(APPEND all_sym_files ${SYM_FILE}) 74 | 75 | ENDFOREACH(device) 76 | 77 | ADD_CUSTOM_TARGET( 78 | ${EXE_NAME} ALL 79 | DEPENDS ${all_elf_files} 80 | ) 81 | 82 | GET_DIRECTORY_PROPERTY(clean_files ADDITIONAL_MAKE_CLEAN_FILES) 83 | LIST(APPEND clean_files ${all_map_files}) 84 | LIST(APPEND clean_files ${all_lst_files}) 85 | LIST(APPEND clean_files ${all_elf_files}) 86 | LIST(APPEND clean_files ${all_sym_files}) 87 | SET_DIRECTORY_PROPERTIES(PROPERTIES 88 | ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}" 89 | ) 90 | ENDFUNCTION(add_platform_executable) 91 | 92 | # Wrapper around ADD_LIBRARY, which adds the necessary -mmcu flags and 93 | # sets up builds for multiple devices. 94 | FUNCTION(add_platform_library LIBRARY_NAME LIBRARY_TYPE DEPENDENCIES) 95 | SET(DEVICES ${SUPPORTED_DEVICES}) 96 | 97 | SET(LIB_NAME ${LIBRARY_NAME}) 98 | LIST(REMOVE_AT ARGV 0) 99 | 100 | SET(DEPS ${DEPENDENCIES}) 101 | SEPARATE_ARGUMENTS(DEPS) 102 | LIST(REMOVE_AT ARGV 0) 103 | 104 | SET(TYPE ${LIBRARY_TYPE}) 105 | LIST(REMOVE_AT ARGV 0) 106 | 107 | FOREACH(device ${DEVICES}) 108 | SET(LIB_DNAME ${LIB_NAME}-${device}) 109 | SET(SYM_FILE ${LIB_DNAME}.sym) 110 | SET(ASM_FILE ${LIB_DNAME}.s) 111 | SET(LIB_FILE lib${LIB_DNAME}.a) 112 | 113 | ADD_LIBRARY(${LIB_DNAME} ${TYPE} ${ARGN}) 114 | SET_TARGET_PROPERTIES( 115 | ${LIB_DNAME} PROPERTIES 116 | COMPILE_FLAGS "-mmcu=${device}" 117 | LINK_FLAGS "-mmcu=${device} ${EXTRA_LINKER_FLAGS}" 118 | ) 119 | 120 | SET(DDEPS ${DEPS}) 121 | FOREACH(dep ${DEPS}) 122 | LIST_REPLACE(DDEPS "${dep}" "${dep}-${device}") 123 | ENDFOREACH(dep) 124 | IF(DDEPS) 125 | TARGET_LINK_LIBRARIES(${LIB_DNAME} ${DDEPS}) 126 | ENDIF(DDEPS) 127 | ADD_CUSTOM_TARGET( 128 | ${SYM_FILE} ALL 129 | ${AVR_NM} -l -a -S -s --size-sort ${LIB_FILE} > ${SYM_FILE} 130 | DEPENDS ${LIB_DNAME} 131 | ) 132 | ADD_CUSTOM_TARGET( 133 | ${ASM_FILE} ALL 134 | ${AVR_OBJDUMP} -h -D -f -l -S -a ${LIB_FILE} > ${ASM_FILE} 135 | DEPENDS ${LIB_DNAME} 136 | ) 137 | LIST(APPEND all_lib_files ${LIB_FILE}) 138 | LIST(APPEND all_sym_files ${SYM_FILE}) 139 | LIST(APPEND all_asm_files ${ASM_FILE}) 140 | ENDFOREACH(device) 141 | 142 | GET_DIRECTORY_PROPERTY(clean_files ADDITIONAL_MAKE_CLEAN_FILES) 143 | LIST(APPEND clean_files ${all_lib_files}) 144 | LIST(APPEND clean_files ${all_sym_files}) 145 | LIST(APPEND clean_files ${all_asm_files}) 146 | SET_DIRECTORY_PROPERTIES(PROPERTIES 147 | ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}" 148 | ) 149 | ENDFUNCTION(add_platform_library) 150 | -------------------------------------------------------------------------------- /Platform/msp430-gcc.cmake: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE("${TOOLCHAINS_PATH}/Platform/common.cmake") 3 | 4 | # Wrapper around ADD_EXECUTABLE, which adds the necessary -mmcu flags and 5 | # sets up builds for multiple devices. Also creates targets to generate 6 | # disassembly listings, size outputs, map files, and to upload to device. 7 | # Also adds all these extra files created including map files to the clean 8 | # list. 9 | FUNCTION(add_platform_executable EXECUTABLE_NAME DEPENDENCIES) 10 | SET(DEVICES ${SUPPORTED_DEVICES}) 11 | 12 | SET(EXE_NAME ${EXECUTABLE_NAME}) 13 | LIST(REMOVE_AT ARGV 0) 14 | 15 | SET(DEPS ${DEPENDENCIES}) 16 | SEPARATE_ARGUMENTS(DEPS) 17 | LIST(REMOVE_AT ARGV 0) 18 | 19 | FOREACH(device ${DEVICES}) 20 | 21 | SET(ELF_FILE ${EXE_NAME}-${device}.elf) 22 | SET(MAP_FILE ${EXE_NAME}-${device}.map) 23 | SET(LST_FILE ${EXE_NAME}-${device}.lst) 24 | SET(SYM_FILE ${EXE_NAME}-${device}.sym) 25 | 26 | ADD_EXECUTABLE(${ELF_FILE} ${ARGN}) 27 | SET_TARGET_PROPERTIES( 28 | ${ELF_FILE} PROPERTIES 29 | COMPILE_FLAGS "-mmcu=${device}" 30 | LINK_FLAGS "-mmcu=${device} -Wl,-Map,${MAP_FILE} ${EXTRA_LINKER_FLAGS} -L ${MSP430_TI_COMPILER_FOLDER}/include -T ${device}.ld" 31 | ) 32 | 33 | SET(DDEPS ${DEPS}) 34 | 35 | IF(DDEPS) 36 | LIST(REMOVE_DUPLICATES DDEPS) 37 | FOREACH(dep ${DDEPS}) 38 | LIST_REPLACE(DDEPS "${dep}" "${dep}-${device}") 39 | ENDFOREACH(dep) 40 | TARGET_LINK_LIBRARIES(${ELF_FILE} ${DDEPS}) 41 | ENDIF(DDEPS) 42 | 43 | ADD_CUSTOM_TARGET( 44 | ${EXE_NAME}-${device}.lst ALL 45 | ${MSP430_OBJDUMP} -h -S ${ELF_FILE} > ${LST_FILE} 46 | DEPENDS ${ELF_FILE} 47 | ) 48 | 49 | ADD_CUSTOM_TARGET( 50 | ${EXE_NAME}-${device}-size ALL 51 | ${MSP430_SIZE} ${ELF_FILE} 52 | DEPENDS ${ELF_FILE} 53 | ) 54 | 55 | ADD_CUSTOM_TARGET( 56 | ${EXE_NAME}-${device}.sym ALL 57 | ${MSP430_NM} -l -a -S -s --size-sort ${ELF_FILE} > ${SYM_FILE} 58 | DEPENDS ${ELF_FILE} 59 | ) 60 | 61 | ADD_CUSTOM_TARGET( 62 | ${EXE_NAME}-${device}-upload 63 | # TODO This needs to be better structured to allow 64 | # programmer change 65 | ${PROGBIN} -n ${PROGRAMMER} \"prog ${ELF_FILE}\" --allow-fw-update 66 | DEPENDS ${ELF_FILE} 67 | ) 68 | 69 | LIST(APPEND all_lst_files ${LST_FILE}) 70 | LIST(APPEND all_elf_files ${ELF_FILE}) 71 | LIST(APPEND all_map_files ${MAP_FILE}) 72 | LIST(APPEND all_sym_files ${SYM_FILE}) 73 | 74 | ENDFOREACH(device) 75 | 76 | ADD_CUSTOM_TARGET( 77 | ${EXE_NAME} ALL 78 | DEPENDS ${all_elf_files} 79 | ) 80 | 81 | GET_DIRECTORY_PROPERTY(clean_files ADDITIONAL_MAKE_CLEAN_FILES) 82 | LIST(APPEND clean_files ${all_map_files}) 83 | LIST(APPEND clean_files ${all_lst_files}) 84 | LIST(APPEND clean_files ${all_elf_files}) 85 | LIST(APPEND clean_files ${all_sym_files}) 86 | SET_DIRECTORY_PROPERTIES(PROPERTIES 87 | ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}" 88 | ) 89 | ENDFUNCTION(add_platform_executable) 90 | 91 | # Wrapper around ADD_LIBRARY, which adds the necessary -mmcu flags and 92 | # sets up builds for multiple devices. 93 | FUNCTION(add_platform_library LIBRARY_NAME LIBRARY_TYPE DEPENDENCIES) 94 | SET(DEVICES ${SUPPORTED_DEVICES}) 95 | 96 | SET(LIB_NAME ${LIBRARY_NAME}) 97 | LIST(REMOVE_AT ARGV 0) 98 | 99 | SET(DEPS ${DEPENDENCIES}) 100 | SEPARATE_ARGUMENTS(DEPS) 101 | LIST(REMOVE_AT ARGV 0) 102 | 103 | SET(TYPE ${LIBRARY_TYPE}) 104 | LIST(REMOVE_AT ARGV 0) 105 | 106 | FOREACH(device ${DEVICES}) 107 | SET(LIB_DNAME ${LIB_NAME}-${device}) 108 | SET(SYM_FILE ${LIB_DNAME}.sym) 109 | SET(ASM_FILE ${LIB_DNAME}.s) 110 | SET(LIB_FILE lib${LIB_DNAME}.a) 111 | 112 | ADD_LIBRARY(${LIB_DNAME} ${TYPE} ${ARGN}) 113 | SET_TARGET_PROPERTIES( 114 | ${LIB_DNAME} PROPERTIES 115 | COMPILE_FLAGS "-mmcu=${device}" 116 | LINK_FLAGS "-mmcu=${device} ${EXTRA_LINKER_FLAGS} -L ${MSP430_TI_COMPILER_FOLDER}/include -T ${device}.ld" 117 | ) 118 | 119 | SET(DDEPS ${DEPS}) 120 | FOREACH(dep ${DEPS}) 121 | LIST_REPLACE(DDEPS "${dep}" "${dep}-${device}") 122 | ENDFOREACH(dep) 123 | IF(DDEPS) 124 | TARGET_LINK_LIBRARIES(${LIB_DNAME} ${DDEPS}) 125 | ENDIF(DDEPS) 126 | ADD_CUSTOM_TARGET( 127 | ${SYM_FILE} 128 | ${MSP430_NM} -l -a -S -s --size-sort ${LIB_FILE} > ${SYM_FILE} 129 | DEPENDS ${LIB_DNAME} 130 | ) 131 | ADD_CUSTOM_TARGET( 132 | ${ASM_FILE} 133 | ${MSP430_OBJDUMP} -h -D -f -l -S -a ${LIB_FILE} > ${ASM_FILE} 134 | DEPENDS ${LIB_DNAME} 135 | ) 136 | LIST(APPEND all_lib_files ${LIB_FILE}) 137 | LIST(APPEND all_sym_files ${SYM_FILE}) 138 | LIST(APPEND all_asm_files ${ASM_FILE}) 139 | ENDFOREACH(device) 140 | 141 | GET_DIRECTORY_PROPERTY(clean_files ADDITIONAL_MAKE_CLEAN_FILES) 142 | LIST(APPEND clean_files ${all_lib_files}) 143 | LIST(APPEND clean_files ${all_sym_files}) 144 | LIST(APPEND clean_files ${all_asm_files}) 145 | SET_DIRECTORY_PROPERTIES(PROPERTIES 146 | ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}" 147 | ) 148 | ENDFUNCTION(add_platform_library) 149 | -------------------------------------------------------------------------------- /resources/doc/jquery.smartmenus.bootstrap.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * SmartMenus jQuery Plugin Bootstrap Addon - v0.3.1 - November 1, 2016 3 | * http://www.smartmenus.org/ 4 | * 5 | * Copyright Vasil Dinkov, Vadikom Web Ltd. 6 | * http://vadikom.com 7 | * 8 | * Licensed MIT 9 | */ 10 | 11 | (function(factory) { 12 | if (typeof define === 'function' && define.amd) { 13 | // AMD 14 | define(['jquery', 'jquery.smartmenus'], factory); 15 | } else if (typeof module === 'object' && typeof module.exports === 'object') { 16 | // CommonJS 17 | module.exports = factory(require('jquery')); 18 | } else { 19 | // Global jQuery 20 | factory(jQuery); 21 | } 22 | } (function($) { 23 | 24 | $.extend($.SmartMenus.Bootstrap = {}, { 25 | keydownFix: false, 26 | init: function() { 27 | // init all navbars that don't have the "data-sm-skip" attribute set 28 | var $navbars = $('ul.navbar-nav:not([data-sm-skip])'); 29 | $navbars.each(function() { 30 | var $this = $(this), 31 | obj = $this.data('smartmenus'); 32 | // if this navbar is not initialized 33 | if (!obj) { 34 | $this.smartmenus({ 35 | 36 | // these are some good default options that should work for all 37 | // you can, of course, tweak these as you like 38 | subMenusSubOffsetX: 2, 39 | subMenusSubOffsetY: -6, 40 | subIndicators: false, 41 | collapsibleShowFunction: null, 42 | collapsibleHideFunction: null, 43 | rightToLeftSubMenus: $this.hasClass('navbar-right'), 44 | bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom') 45 | }) 46 | .bind({ 47 | // set/unset proper Bootstrap classes for some menu elements 48 | 'show.smapi': function(e, menu) { 49 | var $menu = $(menu), 50 | $scrollArrows = $menu.dataSM('scroll-arrows'); 51 | if ($scrollArrows) { 52 | // they inherit border-color from body, so we can use its background-color too 53 | $scrollArrows.css('background-color', $(document.body).css('background-color')); 54 | } 55 | $menu.parent().addClass('open'); 56 | }, 57 | 'hide.smapi': function(e, menu) { 58 | $(menu).parent().removeClass('open'); 59 | } 60 | }); 61 | 62 | function onInit() { 63 | // set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true) 64 | $this.find('a.current').parent().addClass('active'); 65 | // remove any Bootstrap required attributes that might cause conflicting issues with the SmartMenus script 66 | $this.find('a.has-submenu').each(function() { 67 | var $this = $(this); 68 | if ($this.is('[data-toggle="dropdown"]')) { 69 | $this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle'); 70 | } 71 | if ($this.is('[role="button"]')) { 72 | $this.dataSM('bs-role-button', true).removeAttr('role'); 73 | } 74 | }); 75 | } 76 | 77 | onInit(); 78 | 79 | function onBeforeDestroy() { 80 | $this.find('a.current').parent().removeClass('active'); 81 | $this.find('a.has-submenu').each(function() { 82 | var $this = $(this); 83 | if ($this.dataSM('bs-data-toggle-dropdown')) { 84 | $this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown'); 85 | } 86 | if ($this.dataSM('bs-role-button')) { 87 | $this.attr('role', 'button').removeDataSM('bs-role-button'); 88 | } 89 | }); 90 | } 91 | 92 | obj = $this.data('smartmenus'); 93 | 94 | // custom "isCollapsible" method for Bootstrap 95 | obj.isCollapsible = function() { 96 | return !/^(left|right)$/.test(this.$firstLink.parent().css('float')); 97 | }; 98 | 99 | // custom "refresh" method for Bootstrap 100 | obj.refresh = function() { 101 | $.SmartMenus.prototype.refresh.call(this); 102 | onInit(); 103 | // update collapsible detection 104 | detectCollapsible(true); 105 | }; 106 | 107 | // custom "destroy" method for Bootstrap 108 | obj.destroy = function(refresh) { 109 | onBeforeDestroy(); 110 | $.SmartMenus.prototype.destroy.call(this, refresh); 111 | }; 112 | 113 | // keep Bootstrap's default behavior for parent items when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav 114 | // i.e. use the whole item area just as a sub menu toggle and don't customize the carets 115 | if ($this.is('[data-sm-skip-collapsible-behavior]')) { 116 | $this.bind({ 117 | // click the parent item to toggle the sub menus (and reset deeper levels and other branches on click) 118 | 'click.smapi': function(e, item) { 119 | if (obj.isCollapsible()) { 120 | var $item = $(item), 121 | $sub = $item.parent().dataSM('sub'); 122 | if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) { 123 | obj.itemActivate($item); 124 | obj.menuHide($sub); 125 | return false; 126 | } 127 | } 128 | } 129 | }); 130 | } 131 | 132 | // onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class 133 | var winW; 134 | function detectCollapsible(force) { 135 | var newW = obj.getViewportWidth(); 136 | if (newW != winW || force) { 137 | var $carets = $this.find('.caret'); 138 | if (obj.isCollapsible()) { 139 | $this.addClass('sm-collapsible'); 140 | // set "navbar-toggle" class to carets (so they look like a button) if the "data-sm-skip-collapsible-behavior" attribute is not set to the ul.navbar-nav 141 | if (!$this.is('[data-sm-skip-collapsible-behavior]')) { 142 | $carets.addClass('navbar-toggle sub-arrow'); 143 | } 144 | } else { 145 | $this.removeClass('sm-collapsible'); 146 | if (!$this.is('[data-sm-skip-collapsible-behavior]')) { 147 | $carets.removeClass('navbar-toggle sub-arrow'); 148 | } 149 | } 150 | winW = newW; 151 | } 152 | } 153 | detectCollapsible(); 154 | $(window).bind('resize.smartmenus' + obj.rootId, detectCollapsible); 155 | } 156 | }); 157 | // keydown fix for Bootstrap 3.3.5+ conflict 158 | if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) { 159 | // unhook BS keydown handler for all dropdowns 160 | $(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu'); 161 | // restore BS keydown handler for dropdowns that are not inside SmartMenus navbars 162 | if ($.fn.dropdown && $.fn.dropdown.Constructor) { 163 | $(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu:not([id^="sm-"])', $.fn.dropdown.Constructor.prototype.keydown); 164 | } 165 | $.SmartMenus.Bootstrap.keydownFix = true; 166 | } 167 | } 168 | }); 169 | 170 | // init ondomready 171 | $($.SmartMenus.Bootstrap.init); 172 | 173 | return $; 174 | })); -------------------------------------------------------------------------------- /propeller-gcc.md: -------------------------------------------------------------------------------- 1 | 2 | Warning : Nothing here has been tested with actual hardware yet. In most cases, I've just checked that the compiler runs with no input files and spits out the usage instructions. This is a woefully inadequate test. So if you do use these instruction, well, let me know if they happen to work. 3 | 4 | 5 | Toolchain Location 6 | ------------------ 7 | 8 | This is going to be a toolchain with a number of tools, most of which need manual installations. In order to try to maintain some degree of sanity, we're going to push as much as possible into a single folder which lives outside the usual folders. Consider the choice of permissions to give to these folders. The commands here expect you to give yourself ownership over the installed files. A more traditional approach would leave ownership to root, with read permissions set for the appropriate user / group. Whatever you decide, keep permissions in mind when you execute commands that copy files into that folder. 9 | 10 | $ sudo mkdir -p /opt/parallax/propeller 11 | $ sudo chown -R [username]:[group] /opt/parallax 12 | $ mkdir /opt/parallax/propeller/bin 13 | 14 | We'll also add the bin folder to system `$PATH`, so that the tools are readily available. To do this, add the following line to `~/.bashrc`. If you ever need the propeller tools to disappear from system $PATH, remove or comment this line out and restart the shell. 15 | 16 | export PATH="/opt/parallax/propeller/bin:$PATH" 17 | 18 | Spin is a langauge designed specifically for Propeller by the same chap who designed the processor. While this toolchain should (hopefully) provide a full gcc toolchain capable of handling C and C++ code, it probably is a good idea to have a Spin toolchain available as well. 19 | 20 | 21 | OpenSpin 22 | -------- 23 | 24 | See 25 | 26 | > The official Spin tool for linux is called openspin. ... It's a command line only tool. There are also 3rd party Spin compilers: bstc, homespun, and fastspin. All have Linux ports. fastspin differs from the others in that it produces native code rather than the standard interpreted Spin bytecode. 27 | 28 | I don't yet know what the practical tradeoffs between these tools are. The official OpenSpin is what these instructions are for, though instructions for the other spin tools may be added as and when I find reason to try to install them. 29 | 30 | NOTE : The binary distribution from TeamCity used for the GCC installation includes OpenSpin as well, so it should not be necessary to install it separately. There are instructions to do so here, though, if you just want a spin tool or if you compile GCC from sources. Note that if you do install OpenSpin with these instructions and then install GCC from the TeamCity build with these instuctions, you will end up not having your own OpenSpin on the $PATH, since both create the `/opt/parallax/propeller/bin/openspin` file. 31 | 32 | 33 | 34 | Download the latest release from the link above and untar it somewhere. Run make to build the compiler. Note that the repository only explicitly lists GCC 4.6 and 4.8 as acceptable GCC versions, though it does say later versions should be fine. For the moment, we assume it compiles fine with system GCC (at the time of this writing 7.3.0-16ubuntu3). 35 | 36 | $ tar xvzf OpenSpin-1.00.78.tar.gz 37 | $ cd OpenSpin-1.00.78/ 38 | $ make 39 | 40 | This generates build files in a folder called `build`. We move these files into the toolchain folder we created earlier and create a symlink to the compiler binary to expose it on the $PATH. 41 | 42 | $ cd build 43 | $ mkdir /opt/parallax/propeller/openspin 44 | $ mv * /opt/parallax/propeller/openspin 45 | $ ln -s /opt/parallax/propeller/openspin/openspin /opt/parallax/propeller/bin/openspin 46 | 47 | This should put openspin into path and allow it to be used directly. 48 | 49 | $ openspin 50 | 51 | There is a bweir fork of OpenSpin. I'm not sure what it does differently. It seems to also do wildly different release numbering. 52 | 53 | 54 | GCC Versions 55 | ------------ 56 | 57 | See again 58 | 59 | > The "official" port of gcc to the propeller is gcc 4.6.1. There is also a beta port of gcc 6.0.0. ... Both work reasonably well, although the gcc 6.0.0 port is incompatible with the 4.6.1 port in some way that affects the Parallax educational libraries, and so it's never been officially adopted. Basically gcc 4.6.1 worked well enough for Parallax's purposes, so it's been frozen (which is why the repositories haven't been updated for a long time). The IDE for gcc 4.6.1 is called SimpleIDE. 60 | 61 | There are two major propeller-gcc github repositories on github : 62 | 63 | - The official repository with only 4.6.1 64 | - A repository owned by dbetz which seems to compile both 4.6.1 and 6.0.0 . This repository is the one used by the [propeller gcc docker images](https://forums.parallax.com/discussion/168418/building-propgcc-with-docker/p1) and possibly the one used by PropWare. (While PropWare links to the official repository, David Zemon, who made the docker images, also maintains PropWare. Also, there are GCC 6 builds there.) 65 | 66 | While I would typically stick with the official repository, given that the official repository hasn't changed in over 2 years, it _might_ be a relatively safe bet that the dbetz fork is stable enough for 4.6.1. It also should make it less of a hassle to switch to GCC 6.0.0 if necessary. 67 | 68 | The following instructions install GCC using the binary tarballs linked to within PropWare, presumably the TeamCity version. It's probably not worth the trouble to compile it from source. 69 | 70 | GCC 4.6.1 ("Official") 71 | ---------------------- 72 | 73 | Download the GCC4 binary from . Untar it somewhere. You will see that there is a parallax folder created, which contains the toolchain entirely within it. We're just going to move the toolchain wholesale into our toolchain folder. If any of those folders existed previously, such as a bin folder from an OpenSpin install, make sure to move the contents of that folder to the correct place as well. These should be immediately apparant by files left in the source tree after the first move is completed. 74 | 75 | $ tar xvzf propellergcc-alpha_v1_9_0-gcc4-linux-x64.tar.gz 76 | $ mv parallax/* /opt/parallax/propeller/ 77 | $ mv parallax/bin/* /opt/parallax/propeller/bin/ 78 | 79 | At the end of this, you should have the gcc (v4.6.1) toolchain with the propeller-elf- prefix installed and in your $PATH. The following programs will also now exist on your path : 80 | 81 | - openspin 82 | - gdbstub 83 | - propeller-load 84 | - spin2cpp 85 | - spinsim 86 | 87 | These instructions would probably work as is for the GCC 6 build as well, though I haven't checked. Note that having both GCC 4 and GCC 6 installed simultaneously is probably not a good idea, and you will have to play around with $PATH to switch between them, besides having to make sure they are both installed into separate folders since the executable names are the same. 88 | 89 | -------------------------------------------------------------------------------- /resources/patches/slac460y.fixes.patch: -------------------------------------------------------------------------------- 1 | From aa1950d9629748856f187cad1782a1495b7a1702 Mon Sep 17 00:00:00 2001 2 | From: Chintalagiri Shashank 3 | Date: Wed, 12 Jun 2019 02:15:06 +0530 4 | Subject: [PATCH] Fixes 5 | 6 | --- 7 | DLL430_v3/src/DLL430_OldApiV3.cpp | 8 ++++---- 8 | DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp | 2 +- 9 | DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp | 10 +++++++--- 10 | DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h | 6 +++++- 11 | .../MSPBSL_PhysicalInterfaceSerialUART.cpp | 14 +++++++------- 12 | .../MSPBSL_PhysicalInterfaceUSB.cpp | 2 +- 13 | 6 files changed, 25 insertions(+), 17 deletions(-) 14 | 15 | diff --git a/DLL430_v3/src/DLL430_OldApiV3.cpp b/DLL430_v3/src/DLL430_OldApiV3.cpp 16 | index f333ed1..8df884d 100644 17 | --- a/DLL430_v3/src/DLL430_OldApiV3.cpp 18 | +++ b/DLL430_v3/src/DLL430_OldApiV3.cpp 19 | @@ -330,7 +330,7 @@ bool DLL430_OldApiV3::loadDeviceDb(const char* file) 20 | catch (const std::runtime_error& e) 21 | { 22 | #ifndef NDEBUG 23 | - ofstream("xml_error.log") << e.what() << endl; 24 | + std::ofstream("xml_error.log") << e.what() << endl; 25 | #endif 26 | log(LogTarget::ERR, DEVICE_DB_ERR, e.what()); 27 | return false; 28 | @@ -356,7 +356,7 @@ bool DLL430_OldApiV3::DumpDeviceDb(const char* file) 29 | catch (const std::runtime_error& e) 30 | { 31 | #ifndef NDEBUG 32 | - ofstream("xml_error.log") << e.what() << endl; 33 | + std::ofstream("xml_error.log") << e.what() << endl; 34 | #endif 35 | log(LogTarget::ERR, DEVICE_DB_ERR, e.what()); 36 | return false; 37 | @@ -3865,7 +3865,7 @@ bool DLL430_OldApiV3::FET_FwUpdate( 38 | #endif 39 | UpdateLog.append("\n---------------------Firmware upate end--------------------------\n"); 40 | 41 | - ofstream(logfile.c_str(), ios::app | ios::out) << UpdateLog; 42 | + std::ofstream(logfile.c_str(), ios::app | ios::out) << UpdateLog; 43 | } 44 | } 45 | 46 | @@ -3907,7 +3907,7 @@ bool DLL430_OldApiV3::FET_FwUpdate( 47 | #endif 48 | UpdateLog.append("\n---------------------Firmware upate end--------------------------\n"); 49 | 50 | - ofstream(logfile.c_str(), ios::app | ios::out) << UpdateLog; 51 | + std::ofstream(logfile.c_str(), ios::app | ios::out) << UpdateLog; 52 | } 53 | } 54 | } 55 | diff --git a/DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp b/DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp 56 | index cb8ea08..346c8ef 100644 57 | --- a/DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp 58 | +++ b/DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp 59 | @@ -75,7 +75,7 @@ 60 | #include "../../../../Bios/include/MSP_FetDcdcControllerV2x.h" 61 | 62 | //Removed due to license limitations 63 | -//#define FPGA_UPDATE 64 | +#define FPGA_UPDATE 65 | 66 | #ifdef FPGA_UPDATE 67 | #include "../../../../Bios/include/MSP_FetFpgaHal.h" 68 | diff --git a/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp b/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp 69 | index ecb21fb..e06caca 100644 70 | --- a/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp 71 | +++ b/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp 72 | @@ -375,7 +375,11 @@ std::string UsbCdcIoChannel::retrieveSerialFromId(const std::string& id) 73 | 74 | bool UsbCdcIoChannel::openPort() 75 | { 76 | - ioService = new boost::asio::io_service; 77 | + #if BOOST_VERSION < 106600 78 | + ioService = new boost::asio::io_service; 79 | + #else 80 | + ioService = new boost::asio::io_context; 81 | + #endif 82 | port = new boost::asio::serial_port(*ioService); 83 | timer = new boost::asio::deadline_timer(*ioService); 84 | 85 | @@ -384,7 +388,7 @@ bool UsbCdcIoChannel::openPort() 86 | int retry = 5; 87 | while (ec && --retry ) 88 | { 89 | - this_thread::sleep_for(chrono::milliseconds(5)); 90 | + this_thread::sleep_for(std::chrono::milliseconds(5)); 91 | ec = port->open(portInfo.path, ec); 92 | } 93 | 94 | @@ -409,7 +413,7 @@ void UsbCdcIoChannel::retrieveStatus() 95 | { 96 | openPort(); 97 | //Seeing issues on some platforms (eg. Ubuntu) when port is immediately closed again 98 | - this_thread::sleep_for(chrono::milliseconds(100)); 99 | + this_thread::sleep_for(std::chrono::milliseconds(100)); 100 | close(); 101 | } 102 | } 103 | diff --git a/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h b/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h 104 | index 3ea4c4f..3715048 100644 105 | --- a/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h 106 | +++ b/DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h 107 | @@ -73,7 +73,11 @@ namespace TI 108 | 109 | private: 110 | std::vector inputBuffer; 111 | - boost::asio::io_service* ioService; 112 | + #if BOOST_VERSION < 106600 113 | + boost::asio::io_service* ioService; 114 | + #else 115 | + boost::asio::io_context* ioService; 116 | + #endif 117 | boost::asio::serial_port* port; 118 | boost::asio::deadline_timer* timer; 119 | ComState comState; 120 | diff --git a/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp b/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp 121 | index 3efa8a2..e6d9112 100644 122 | --- a/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp 123 | +++ b/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp 124 | @@ -193,27 +193,27 @@ void MSPBSL_PhysicalInterfaceSerialUART::invokeBSL(uint16_t method) 125 | 126 | port->set_option(RESETControl(LOW_SIGNAL)); 127 | port->set_option(TESTControl(LOW_SIGNAL)); 128 | - this_thread::sleep_for(chrono::milliseconds(10)); 129 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 130 | port->set_option(TESTControl(HIGH_SIGNAL)); 131 | - this_thread::sleep_for(chrono::milliseconds(10)); 132 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 133 | port->set_option(TESTControl(LOW_SIGNAL)); 134 | - this_thread::sleep_for(chrono::milliseconds(10)); 135 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 136 | port->set_option(TESTControl(HIGH_SIGNAL)); 137 | - this_thread::sleep_for(chrono::milliseconds(10)); 138 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 139 | if( method == STANDARD_INVOKE ) 140 | { 141 | port->set_option(RESETControl(HIGH_SIGNAL)); 142 | - this_thread::sleep_for(chrono::milliseconds(10)); 143 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 144 | port->set_option(TESTControl(LOW_SIGNAL)); 145 | } 146 | else if ( method == BSL_XXXX_INVOKE ) 147 | { 148 | port->set_option(TESTControl(LOW_SIGNAL)); 149 | - this_thread::sleep_for(chrono::milliseconds(10)); 150 | + this_thread::sleep_for(std::chrono::milliseconds(10)); 151 | port->set_option(RESETControl(HIGH_SIGNAL)); 152 | } 153 | 154 | - this_thread::sleep_for(chrono::milliseconds(250)); 155 | + this_thread::sleep_for(std::chrono::milliseconds(250)); 156 | 157 | } 158 | 159 | diff --git a/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp b/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp 160 | index 782f13d..1d55a37 100644 161 | --- a/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp 162 | +++ b/ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.cpp 163 | @@ -189,7 +189,7 @@ uint16_t MSPBSL_PhysicalInterfaceUSB::RX_Bytes( uint8_t* buf, uint16_t numBytes 164 | return ERROR_READING_DATA; 165 | } 166 | 167 | - this_thread::sleep_for(chrono::milliseconds(500)); 168 | + this_thread::sleep_for(std::chrono::milliseconds(500)); 169 | } 170 | 171 | return 0; 172 | -- 173 | 2.20.1 174 | 175 | -------------------------------------------------------------------------------- /resources/doc/customdoxygen.css: -------------------------------------------------------------------------------- 1 | h1, .h1, h2, .h2, h3, .h3{ 2 | font-weight: 200 !important; 3 | } 4 | 5 | .sm-dox a span.sub-arrow { 6 | position: absolute; 7 | top: 50%; 8 | margin-top: -14px; 9 | left: auto; 10 | right: 3px; 11 | width: 28px; 12 | height: 28px; 13 | overflow: hidden; 14 | font: bold 12px / 28px monospace !important; 15 | text-align: center; 16 | text-shadow: none; 17 | background: rgba(255, 255, 255, 0.5); 18 | -moz-border-radius: 5px; 19 | -webkit-border-radius: 5px; 20 | border-radius: 5px 21 | } 22 | 23 | /* Handing of arrow-carets in the smart menus */ 24 | .sm-dox a.highlighted span.sub-arrow:before { 25 | display: block; 26 | content: '-' 27 | } 28 | 29 | .sm-dox a span.sub-arrow { 30 | top: 50%; 31 | margin-top: -2px; 32 | right: 12px; 33 | width: 0; 34 | height: 0; 35 | border-width: 4px; 36 | border-style: solid dashed dashed dashed; 37 | border-color: #283a5d transparent transparent transparent; 38 | background: transparent; 39 | -moz-border-radius: 0; 40 | -webkit-border-radius: 0; 41 | border-radius: 0 42 | } 43 | 44 | .sm-dox a:hover span.sub-arrow { 45 | border-color: red transparent transparent transparent 46 | } 47 | 48 | 49 | .sm-dox.sm-rtl a.has-submenu { 50 | padding-right: 12px; 51 | padding-left: 24px 52 | } 53 | 54 | .sm-dox.sm-rtl a span.sub-arrow { 55 | right: auto; 56 | left: 12px 57 | } 58 | 59 | .sm-dox.sm-rtl.sm-vertical a.has-submenu { 60 | padding: 10px 20px 61 | } 62 | 63 | .sm-dox.sm-rtl.sm-vertical a span.sub-arrow { 64 | right: auto; 65 | left: 8px; 66 | border-style: dashed solid dashed dashed; 67 | border-color: transparent #555 transparent transparent 68 | } 69 | 70 | .sm-dox.sm-rtl ul a.has-submenu { 71 | padding: 10px 20px !important 72 | } 73 | 74 | .sm-dox.sm-rtl ul a span.sub-arrow { 75 | right: auto; 76 | left: 8px; 77 | border-style: dashed solid dashed dashed; 78 | border-color: transparent #555 transparent transparent 79 | } 80 | 81 | .sm-dox.sm-vertical a.disabled { 82 | } 83 | 84 | .sm-dox.sm-vertical a span.sub-arrow { 85 | right: 8px; 86 | top: 50%; 87 | margin-top: -5px; 88 | border-width: 5px; 89 | border-style: dashed dashed dashed solid; 90 | border-color: transparent transparent transparent #555 91 | } 92 | .sm-dox ul a span.sub-arrow { 93 | right: 8px; 94 | top: 50%; 95 | margin-top: -5px; 96 | border-width: 5px; 97 | border-color: transparent transparent transparent #555; 98 | border-style: dashed dashed dashed solid 99 | } 100 | 101 | #navrow1, #navrow2, #navrow3, #navrow4, #navrow5{ 102 | border-bottom: 1px solid #EEEEEE; 103 | } 104 | 105 | .adjust-right { 106 | margin-left: 30px !important; 107 | font-size: 1.15em !important; 108 | } 109 | .navbar{ 110 | border: 0px solid #222 !important; 111 | } 112 | table{ 113 | white-space:pre-wrap !important; 114 | } 115 | /* 116 | =========================== 117 | */ 118 | 119 | 120 | /* Sticky footer styles 121 | -------------------------------------------------- */ 122 | html, 123 | body { 124 | height: 100%; 125 | /* The html and body elements cannot have any padding or margin. */ 126 | } 127 | 128 | /* Wrapper for page content to push down footer */ 129 | #wrap { 130 | min-height: 100%; 131 | height: auto; 132 | /* Negative indent footer by its height */ 133 | margin: 0 auto -60px; 134 | /* Pad bottom by footer height */ 135 | padding: 0 0 60px; 136 | } 137 | 138 | /* Set the fixed height of the footer here */ 139 | #footer { 140 | font-size: 0.9em; 141 | padding: 8px 0px; 142 | background-color: #f5f5f5; 143 | } 144 | 145 | .footer-row { 146 | line-height: 44px; 147 | } 148 | 149 | #footer > .container { 150 | padding-left: 15px; 151 | padding-right: 15px; 152 | } 153 | 154 | .footer-follow-icon { 155 | margin-left: 3px; 156 | text-decoration: none !important; 157 | } 158 | 159 | .footer-follow-icon img { 160 | width: 20px; 161 | } 162 | 163 | .footer-link { 164 | padding-top: 5px; 165 | display: inline-block; 166 | color: #999999; 167 | text-decoration: none; 168 | } 169 | 170 | .footer-copyright { 171 | text-align: center; 172 | } 173 | 174 | 175 | @media (min-width: 992px) { 176 | .footer-row { 177 | text-align: left; 178 | } 179 | 180 | .footer-icons { 181 | text-align: right; 182 | } 183 | } 184 | @media (max-width: 991px) { 185 | .footer-row { 186 | text-align: center; 187 | } 188 | 189 | .footer-icons { 190 | text-align: center; 191 | } 192 | } 193 | 194 | /* DOXYGEN Code Styles 195 | ----------------------------------- */ 196 | 197 | 198 | a.qindex { 199 | font-weight: bold; 200 | } 201 | 202 | a.qindexHL { 203 | font-weight: bold; 204 | background-color: #9CAFD4; 205 | color: #ffffff; 206 | border: 1px double #869DCA; 207 | } 208 | 209 | .contents a.qindexHL:visited { 210 | color: #ffffff; 211 | } 212 | 213 | a.code, a.code:visited, a.line, a.line:visited { 214 | color: #4665A2; 215 | } 216 | 217 | a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { 218 | color: #4665A2; 219 | } 220 | 221 | /* @end */ 222 | 223 | dl.el { 224 | margin-left: -1cm; 225 | } 226 | 227 | pre.fragment { 228 | border: 1px solid #C4CFE5; 229 | background-color: #FBFCFD; 230 | padding: 4px 6px; 231 | margin: 4px 8px 4px 2px; 232 | overflow: auto; 233 | word-wrap: break-word; 234 | font-size: 9pt; 235 | line-height: 125%; 236 | font-family: monospace, fixed; 237 | font-size: 105%; 238 | } 239 | 240 | div.fragment { 241 | padding: 4px 6px; 242 | margin: 4px 8px 4px 2px; 243 | border: 1px solid #C4CFE5; 244 | } 245 | 246 | div.line { 247 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 248 | font-size: 12px; 249 | min-height: 13px; 250 | line-height: 1.0; 251 | text-wrap: unrestricted; 252 | white-space: -moz-pre-wrap; /* Moz */ 253 | white-space: -pre-wrap; /* Opera 4-6 */ 254 | white-space: -o-pre-wrap; /* Opera 7 */ 255 | white-space: pre-wrap; /* CSS3 */ 256 | word-wrap: normal; /* IE 5.5+ */ 257 | text-indent: -53px; 258 | padding-left: 53px; 259 | padding-bottom: 0px; 260 | margin: 0px; 261 | -webkit-transition-property: background-color, box-shadow; 262 | -webkit-transition-duration: 0.5s; 263 | -moz-transition-property: background-color, box-shadow; 264 | -moz-transition-duration: 0.5s; 265 | -ms-transition-property: background-color, box-shadow; 266 | -ms-transition-duration: 0.5s; 267 | -o-transition-property: background-color, box-shadow; 268 | -o-transition-duration: 0.5s; 269 | transition-property: background-color, box-shadow; 270 | transition-duration: 0.5s; 271 | } 272 | div.line:hover{ 273 | background-color: #FBFF00; 274 | } 275 | 276 | div.line.glow { 277 | background-color: cyan; 278 | box-shadow: 0 0 10px cyan; 279 | } 280 | 281 | 282 | span.lineno { 283 | padding-right: 4px; 284 | text-align: right; 285 | color:rgba(0,0,0,0.3); 286 | border-right: 1px solid #EEE; 287 | border-left: 1px solid #EEE; 288 | background-color: #FFF; 289 | white-space: pre; 290 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace ; 291 | } 292 | span.lineno a { 293 | background-color: #FAFAFA; 294 | cursor:pointer; 295 | } 296 | 297 | span.lineno a:hover { 298 | background-color: #EFE200; 299 | color: #1e1e1e; 300 | } 301 | 302 | div.groupHeader { 303 | margin-left: 16px; 304 | margin-top: 12px; 305 | font-weight: bold; 306 | } 307 | 308 | div.groupText { 309 | margin-left: 16px; 310 | font-style: italic; 311 | } 312 | 313 | /* @group Code Colorization */ 314 | 315 | span.keyword { 316 | color: #008000 317 | } 318 | 319 | span.keywordtype { 320 | color: #604020 321 | } 322 | 323 | span.keywordflow { 324 | color: #e08000 325 | } 326 | 327 | span.comment { 328 | color: #800000 329 | } 330 | 331 | span.preprocessor { 332 | color: #806020 333 | } 334 | 335 | span.stringliteral { 336 | color: #002080 337 | } 338 | 339 | span.charliteral { 340 | color: #008080 341 | } 342 | 343 | span.vhdldigit { 344 | color: #ff00ff 345 | } 346 | 347 | span.vhdlchar { 348 | color: #000000 349 | } 350 | 351 | span.vhdlkeyword { 352 | color: #700070 353 | } 354 | 355 | span.vhdllogic { 356 | color: #ff0000 357 | } 358 | 359 | blockquote { 360 | background-color: #F7F8FB; 361 | border-left: 2px solid #9CAFD4; 362 | margin: 0 24px 0 4px; 363 | padding: 0 12px 0 16px; 364 | } 365 | 366 | /*---------------- Search Box */ 367 | 368 | #search-box { 369 | margin: 10px 0px; 370 | } 371 | #search-box .close { 372 | display: none; 373 | position: absolute; 374 | right: 0px; 375 | padding: 6px 12px; 376 | z-index: 5; 377 | } 378 | 379 | /*---------------- Search results window */ 380 | 381 | #search-results-window { 382 | display: none; 383 | } 384 | 385 | iframe#MSearchResults { 386 | width: 100%; 387 | height: 15em; 388 | } 389 | 390 | .SRChildren { 391 | padding-left: 3ex; padding-bottom: .5em 392 | } 393 | .SRPage .SRChildren { 394 | display: none; 395 | } 396 | a.SRScope { 397 | display: block; 398 | } 399 | a.SRSymbol:focus, a.SRSymbol:active, 400 | a.SRScope:focus, a.SRScope:active { 401 | text-decoration: underline; 402 | } 403 | span.SRScope { 404 | padding-left: 4px; 405 | } 406 | .SRResult { 407 | display: none; 408 | } 409 | 410 | /* class and file list */ 411 | .directory .icona, 412 | .directory .arrow { 413 | height: auto; 414 | } 415 | .directory .icona .icon { 416 | height: 16px; 417 | } 418 | .directory .icondoc { 419 | background-position: 0px 0px; 420 | height: 20px; 421 | } 422 | .directory .iconfopen { 423 | background-position: 0px 0px; 424 | } 425 | .directory td.entry { 426 | padding: 7px 8px 6px 8px; 427 | } 428 | 429 | .table > tbody > tr > td.memSeparator { 430 | line-height: 0; 431 | .table-hover; 432 | 433 | } 434 | 435 | .memItemLeft, .memTemplItemLeft { 436 | white-space: normal; 437 | } 438 | 439 | /* enumerations */ 440 | .panel-body thead > tr { 441 | background-color: #e0e0e0; 442 | } 443 | 444 | /* todo lists */ 445 | .todoname, 446 | .todoname a { 447 | font-weight: bold; 448 | } 449 | 450 | /* Class title */ 451 | .summary { 452 | margin-top: 25px; 453 | } 454 | .page-header { 455 | margin: 20px 0px !important; 456 | } 457 | .page-header .title { 458 | display: inline-block; 459 | } 460 | .page-header .pull-right { 461 | margin-top: 0.3em; 462 | margin-left: 0.5em; 463 | } 464 | .page-header .label { 465 | font-size: 50%; 466 | } 467 | 468 | @media print 469 | { 470 | #top { display: none; } 471 | #side-nav { display: none; } 472 | #nav-path { display: none; } 473 | body { overflow:visible; } 474 | h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } 475 | .summary { display: none; } 476 | .memitem { page-break-inside: avoid; } 477 | #doc-content 478 | { 479 | margin-left:0 !important; 480 | height:auto !important; 481 | width:auto !important; 482 | overflow:inherit; 483 | display:inline; 484 | } 485 | } 486 | 487 | .bs-callout { 488 | padding: 10px; 489 | margin: 10px 0; 490 | border: 1px solid #eee; 491 | border-left-width: 5px; 492 | border-radius: 3px; 493 | } 494 | .bs-callout h4 { 495 | font-size: 14px; 496 | margin-top: 0; 497 | margin-bottom: 5px; 498 | } 499 | .bs-callout p:last-child { 500 | margin-bottom: 0; 501 | } 502 | .bs-callout code { 503 | border-radius: 3px; 504 | } 505 | .bs-callout+.bs-callout { 506 | margin-top: -5px; 507 | } 508 | .bs-callout-default { 509 | border-left-color: #777; 510 | } 511 | .bs-callout-default h4 { 512 | color: #777; 513 | } 514 | .bs-callout-primary { 515 | border-left-color: #428bca; 516 | } 517 | .bs-callout-primary h4 { 518 | color: #428bca; 519 | } 520 | .bs-callout-success { 521 | border-left-color: #5cb85c; 522 | } 523 | .bs-callout-success h4 { 524 | color: #5cb85c; 525 | } 526 | .bs-callout-danger { 527 | border-left-color: #d9534f; 528 | } 529 | .bs-callout-danger h4 { 530 | color: #d9534f; 531 | } 532 | .bs-callout-warning { 533 | border-left-color: #f0ad4e; 534 | } 535 | .bs-callout-warning h4 { 536 | color: #f0ad4e; 537 | } 538 | .bs-callout-info { 539 | border-left-color: #5bc0de; 540 | } 541 | .bs-callout-info h4 { 542 | color: #5bc0de; 543 | } 544 | -------------------------------------------------------------------------------- /resources/doc/doxy-boot.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | $("div.headertitle").addClass("page-header"); 3 | $("div.title").addClass("h1"); 4 | 5 | $('li > a[href="index.html"] > span').before(" "); 6 | $('li > a[href="modules.html"] > span').before(" "); 7 | $('li > a[href="namespaces.html"] > span').before(" "); 8 | $('li > a[href="annotated.html"] > span').before(" "); 9 | $('li > a[href="classes.html"] > span').before(" "); 10 | $('li > a[href="inherits.html"] > span').before(" "); 11 | $('li > a[href="functions.html"] > span').before(" "); 12 | $('li > a[href="functions_func.html"] > span').before(" "); 13 | $('li > a[href="functions_vars.html"] > span').before(" "); 14 | $('li > a[href="functions_enum.html"] > span').before(" "); 15 | $('li > a[href="functions_eval.html"] > span').before(" "); 16 | $('img[src="ftv2ns.png"]').replaceWith('N '); 17 | $('img[src="ftv2cl.png"]').replaceWith('C '); 18 | 19 | $("ul.tablist").addClass("nav nav-pills nav-justified"); 20 | $("ul.tablist").css("margin-top", "0.5em"); 21 | $("ul.tablist").css("margin-bottom", "0.5em"); 22 | $("li.current").addClass("active"); 23 | $("iframe").attr("scrolling", "yes"); 24 | 25 | $("#nav-path > ul").addClass("breadcrumb"); 26 | 27 | $("table.params").addClass("table"); 28 | $("div.ingroups").wrapInner(""); 29 | $("div.levels").css("margin", "0.5em"); 30 | $("div.levels > span").addClass("btn btn-default btn-xs"); 31 | $("div.levels > span").css("margin-right", "0.25em"); 32 | 33 | $("table.directory").addClass("table table-striped"); 34 | $("div.summary > a").addClass("btn btn-default btn-xs"); 35 | $("table.fieldtable").addClass("table"); 36 | $(".fragment").addClass("well"); 37 | $(".memitem").addClass("panel panel-default"); 38 | $(".memproto").addClass("panel-heading"); 39 | $(".memdoc").addClass("panel-body"); 40 | $("span.mlabel").addClass("label label-info"); 41 | 42 | $("table.memberdecls").addClass("table"); 43 | $("[class^=memitem]").addClass("active"); 44 | 45 | $("div.ah").addClass("btn btn-default"); 46 | $("span.mlabels").addClass("pull-right"); 47 | $("table.mlabels").css("width", "100%") 48 | $("td.mlabels-right").addClass("pull-right"); 49 | 50 | $("div.ttc").addClass("panel panel-primary"); 51 | $("div.ttname").addClass("panel-heading"); 52 | $("div.ttname a").css("color", 'white'); 53 | $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body"); 54 | 55 | $('div.fragment.well div.line:first').css('margin-top', '2px'); 56 | $('div.fragment.well div.line:last').css('margin-bottom', '2px'); 57 | 58 | $('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){ 59 | $(this).prepend(''); 60 | $(this).find('tbody > tr:first').prependTo($(this).find('thead')); 61 | 62 | $(this).find('td > span.success').parent().addClass('success'); 63 | $(this).find('td > span.warning').parent().addClass('warning'); 64 | $(this).find('td > span.danger').parent().addClass('danger'); 65 | }); 66 | 67 | 68 | 69 | if($('div.fragment.well div.ttc').length > 0) 70 | { 71 | $('div.fragment.well div.line:first').parent().removeClass('fragment well'); 72 | } 73 | 74 | $('table.memberdecls').find('.memItemRight').each(function(){ 75 | $(this).contents().appendTo($(this).siblings('.memItemLeft')); 76 | $(this).siblings('.memItemLeft').attr('align', 'left'); 77 | }); 78 | 79 | $('table.memberdecls').find('.memTemplItemRight').each(function(){ 80 | $(this).contents().appendTo($(this).siblings('.memTemplItemLeft')); 81 | $(this).siblings('.memTemplItemLeft').attr('align', 'left'); 82 | }); 83 | 84 | function getOriginalWidthOfImg(img_element) { 85 | var t = new Image(); 86 | t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src; 87 | return t.width; 88 | } 89 | 90 | $('div.dyncontent').find('img').each(function(){ 91 | if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width()) 92 | $(this).css('width', '100%'); 93 | }); 94 | 95 | var nav_container = $('#main-nav').detach(); 96 | nav_container.addClass('nav navbar-nav navbar-right'); 97 | $('nav > .container').append(nav_container); 98 | $('#main-nav > ul').addClass('nav navbar-nav navbar-right'); 99 | $('#main-nav * li > ul').addClass('dropdown-menu'); 100 | 101 | 102 | 103 | /* responsive search box */ 104 | //$('#MSearchBox').parent().remove(); 105 | 106 | /* 107 | var nav_container = $('
'); 108 | $('#navrow1').parent().prepend(nav_container); 109 | 110 | var left_nav = $('
'); 111 | for (i = 0; i < 6; i++) { 112 | var navrow = $('#navrow' + i + ' > ul.tablist').detach(); 113 | left_nav.append(navrow); 114 | $('#navrow' + i).remove(); 115 | } 116 | var right_nav = $('
').append('\ 117 | '); 128 | $(nav_container).append(left_nav); 129 | $(nav_container).append(right_nav); 130 | 131 | 132 | $('#MSearchSelectWindow .SelectionMark').remove(); 133 | var search_selectors = $('#MSearchSelectWindow .SelectItem'); 134 | for (var i = 0; i < search_selectors.length; i += 1) { 135 | var element_a = $('').text($(search_selectors[i]).text()); 136 | 137 | element_a.click(function(){ 138 | $('#search-box .dropdown-menu li').removeClass('active'); 139 | $(this).parent().addClass('active'); 140 | searchBox.OnSelectItem($('#search-box li a').index(this)); 141 | searchBox.Search(); 142 | return false; 143 | }); 144 | 145 | var element = $('
  • ').append(element_a); 146 | $('#search-box .dropdown-menu').append(element); 147 | } 148 | $('#MSearchSelectWindow').remove(); 149 | 150 | $('#search-box .close').click(function (){ 151 | searchBox.CloseResultsWindow(); 152 | }); 153 | 154 | $('body').append('
    '); 155 | $('body').append('
    '); 156 | $('body').append('
    '); 157 | 158 | searchBox.searchLabel = ''; 159 | searchBox.DOMSearchField = function() { 160 | return document.getElementById("search-field"); 161 | } 162 | searchBox.DOMSearchClose = function(){ 163 | return document.getElementById("search-close"); 164 | } 165 | */ 166 | /* search results */ 167 | 168 | var results_iframe = $('#MSearchResults').detach(); 169 | $('#MSearchResultsWindow') 170 | .attr('id', 'search-results-window') 171 | .addClass('panel panel-default') 172 | .append( 173 | '
    \ 174 |

    Search Results

    \ 175 |
    \ 176 |
    ' 177 | ); 178 | $('#search-results-window .panel-body').append(results_iframe); 179 | 180 | searchBox.DOMPopupSearchResultsWindow = function() { 181 | return document.getElementById("search-results-window"); 182 | } 183 | 184 | function update_search_results_window() { 185 | $('#search-results-window').removeClass('panel-default panel-success panel-warning panel-danger') 186 | var status = $('#MSearchResults').contents().find('.SRStatus:visible'); 187 | if (status.length > 0) { 188 | switch(status.attr('id')) { 189 | case 'Loading': 190 | case 'Searching': 191 | $('#search-results-window').addClass('panel-warning'); 192 | break; 193 | case 'NoMatches': 194 | $('#search-results-window').addClass('panel-danger'); 195 | break; 196 | default: 197 | $('#search-results-window').addClass('panel-default'); 198 | } 199 | } else { 200 | $('#search-results-window').addClass('panel-success'); 201 | } 202 | } 203 | $('#MSearchResults').load(function() { 204 | $('#MSearchResults').contents().find('link[href="search.css"]').attr('href','../doxygen.css'); 205 | $('#MSearchResults').contents().find('head').append( 206 | ''); 207 | 208 | update_search_results_window(); 209 | 210 | // detect status changes (only for search with external search backend) 211 | var observer = new MutationObserver(function(mutations) { 212 | update_search_results_window(); 213 | }); 214 | var config = { attributes: true}; 215 | 216 | var targets = $('#MSearchResults').contents().find('.SRStatus'); 217 | for (i = 0; i < targets.length; i++) { 218 | observer.observe(targets[i], config); 219 | } 220 | }); 221 | 222 | /* enumerations */ 223 | $('table.fieldtable').removeClass('fieldtable').addClass('table table-striped table-bordered').each(function(){ 224 | $(this).prepend(''); 225 | $(this).find('tbody > tr:first').prependTo($(this).find('thead')); 226 | 227 | $(this).find('td > span.success').parent().addClass('success'); 228 | $(this).find('td > span.warning').parent().addClass('warning'); 229 | $(this).find('td > span.danger').parent().addClass('danger'); 230 | }); 231 | 232 | /* todo list */ 233 | var todoelements = $('.contents > .textblock > dl.reflist > dt, .contents > .textblock > dl.reflist > dd'); 234 | for (var i = 0; i < todoelements.length; i += 2) { 235 | $('.contents > .textblock').append( 236 | '
    ' 237 | + "
    " + $(todoelements[i]).html() + "
    " 238 | + "
    " + $(todoelements[i+1]).html() + "
    " 239 | + '
    '); 240 | } 241 | function rebuilddlcontent(dlelem){ 242 | n = dlelem.children("dd").length; 243 | if (n <= 1){ 244 | return("

    " + dlelem.children("dd").first().html() + "

    "); 245 | } 246 | rval = "
      "; 247 | dlelem.children("dd").each(function(){ 248 | rval += ("
    • " + $(this).html() + "
    • "); 249 | }); 250 | rval += "
    "; 251 | return(rval); 252 | }; 253 | /* notes */ 254 | $('.contents > .textblock > dl.note').each(function(){ 255 | $(this).after('
    ' 256 | + "

    " + $(this).children("dt").html() + "

    " 257 | + rebuilddlcontent($(this)) + "
    "); 258 | }); 259 | 260 | /* warnings */ 261 | $('.contents > .textblock > dl.warning').each(function(){ 262 | $(this).after('
    ' 263 | + "

    " + $(this).children("dt").html() + "

    " 264 | + rebuilddlcontent($(this)) + "
    "); 265 | }); 266 | 267 | /* seealso */ 268 | $('.contents > .textblock > dl.see').each(function(){ 269 | $(this).after('
    ' 270 | + "

    " + $(this).children("dt").html() + "

    " 271 | + rebuilddlcontent($(this)) + "
    "); 272 | }); 273 | 274 | $('.contents > .textblock > dl').remove(); 275 | 276 | 277 | $(".memitem").removeClass('memitem'); 278 | $(".memproto").removeClass('memproto'); 279 | $(".memdoc").removeClass('memdoc'); 280 | $("span.mlabel").removeClass('mlabel'); 281 | $("table.memberdecls").removeClass('memberdecls'); 282 | $("[class^=memitem]").removeClass('memitem'); 283 | $("span.mlabels").removeClass('mlabels'); 284 | $("table.mlabels").removeClass('mlabels'); 285 | $("td.mlabels-right").removeClass('mlabels-right'); 286 | $(".navpath").removeClass('navpath'); 287 | $("li.navelem").removeClass('navelem'); 288 | $("a.el").removeClass('el'); 289 | $("div.ah").removeClass('ah'); 290 | $("div.header").removeClass("header"); 291 | 292 | $('.mdescLeft').each(function(){ 293 | if($(this).html()==" ") { 294 | $(this).siblings('.mdescRight').attr('colspan', 2); 295 | $(this).remove(); 296 | } 297 | }); 298 | $('td.memItemLeft').each(function(){ 299 | if($(this).siblings('.memItemRight').html()=="") { 300 | $(this).attr('colspan', 2); 301 | $(this).siblings('.memItemRight').remove(); 302 | } 303 | }); 304 | $('td.memTemplItemLeft').each(function(){ 305 | if($(this).siblings('.memTemplItemRight').html()=="") { 306 | $(this).attr('colspan', 2); 307 | $(this).siblings('.memTemplItemRight').remove(); 308 | } 309 | }); 310 | //searchBox.CloseResultsWindow(); 311 | }); 312 | -------------------------------------------------------------------------------- /msp430-gcc-ti.md: -------------------------------------------------------------------------------- 1 | 2 | MSP430-GCC-TI Toolchain 3 | ======================= 4 | 5 | The TI GCC (aka "msp430-gcc-opensource", aka "Somnium GCC for msp430") is newer 6 | than the GCC included with various mspgcc versions. Having the uC manufacturer 7 | actively support the compiler and toolchain is usually a good thing. Presumably, 8 | it should also provide better support for TI's `driverlib` and hopefully for TI's 9 | `USP-API`. For these reasons, using the TI msp430-gcc-opensource toolchain is the 10 | preferred route for MSP430 development. 11 | 12 | Installing the MSP430-GCC-TI toolchain 13 | -------------------------------------- 14 | 15 | * Download TI GCC installer including support packages from the TI website 16 | 17 | 18 | * Make the file executable and run the installer. Run as root to be able to 19 | install to system folders (installing to /opt) 20 | 21 | ~~~ 22 | $ chmod a+x msp430-gcc-full-linux-x64-installer-5.1.1.0.run 23 | $ sudo ./msp430-gcc-full-linux-x64-installer-5.1.1.0.run 24 | ~~~ 25 | 26 | * Install the toolchain. Recommended location is `/opt/ti/msp430/gcc` unless you 27 | have a good reason to install it elsewhere. 28 | 29 | * `mspdebug` isn't installed with the toolchain, and should be installed 30 | separately. Beware that mismatched versions of `mspdebug` and `libmsp430.so` 31 | can result in silent failure. While there will be no loud errors, you might 32 | see an inability to program the device. Make sure that whatever version of 33 | `mspdebug` and `libmsp430.so` you're using work as expected. The versions 34 | described presently work with the latest mspdebug release (v0.25) from 35 | , while they don't with the version that 36 | currently ships with Ubuntu (v0.22). 37 | 38 | * Use the `toolchain-msp430-gcc-ti.cmake` toolchain file for cmake. The system 39 | specific changes that may need to be made are : 40 | - `MSP430_TI_COMPILER_FOLDER` : Path of TI GCC installation 41 | - `mspdebug` location etc. should be crosschecked, since TI gcc installation 42 | does not install `mspdebug`. 43 | - Set the correct `CMAKE_MODULE_PATH` (to your toolchains folder) so that 44 | cmake can find toolchains/Platforms. 45 | 46 | * Add the toolchain to your PATH by appending the following to `~/.bashrc`: 47 | 48 | ~~~ 49 | export PATH="/opt/ti/msp430/gcc/bin:${PATH}" 50 | ~~~ 51 | 52 | Debugging using the LP5529 on-board device: 53 | ------------------------------------------- 54 | 55 | * Program the device as usual by `make install` or `make firmware--load`. 56 | 57 | * Use `mspdebug` to connect to the device and provide a gdb remote stub. 58 | 59 | ~~~ 60 | $ mspdebug tilib 61 | ... 62 | Chip ID data: 63 | ver_id: 2955 64 | ver_sub_id: 0000 65 | revision: 18 66 | fab: 55 67 | self: 5555 68 | config: 12 69 | fuses: 55 70 | Device: MSP430F5529 71 | ... 72 | (mspdebug) gdb 73 | Bound to port 2000. Now waiting for connection... 74 | ~~~ 75 | 76 | * Earlier versions (Upto 4.0.1 or so) of the toolchain used `gdb_agent_console` 77 | instead of `mspdebug`. While this approach seems to not work anymore (as of 5.1.1), 78 | if you have trouble using `mspdebug`, you can perhaps try the `gdb_agent_console` 79 | approach. This command should find the debugger and prepare for the connection. 80 | If you happen to have more than one `gdb_agent_console` in your `PATH`, make 81 | sure to use the correct one (located in `/opt/ti/gcc/bin`). You may need to 82 | `chmod +x gdb_agent_console` if you get a permission denied error. 83 | 84 | ~~~ 85 | $ gdb_agent_console /opt/ti/msp430/gcc/msp430.dat 86 | ~~~ 87 | 88 | * Run `msp430-elf-gdb`. You should give it the `elf` file as well so that it knows 89 | the symbols. 90 | 91 | ~~~ 92 | $ cd 93 | $ msp430-elf-gdb application/firmware-msp430f5529.elf 94 | ... [GDB initialization output] 95 | (gdb) target remote :2000 96 | Remote debugging using :2000 97 | 0x000044e4 in __crt0_start () 98 | (gdb) 99 | ~~~ 100 | 101 | 102 | * Ideally, `insight` should be able to run as well. Some obscure TI doc suggests the `GUI`, presumably `insight`, is supported on windows only. 103 | 104 | * Some sample commands run on firmware that's built with TI's `driverlib`: 105 | 106 | ~~~ 107 | (gdb) info address mclk_val 108 | Symbol "mclk_val" is static storage at address 0x2420. 109 | (gdb) info sym 0x2420 110 | mclk_val in section .noinit 111 | (gdb) info address UCS_getMCLK 112 | Symbol "UCS_getMCLK" is a function at address 0x4f50. 113 | (gdb) info sym 0x4f50 114 | UCS_getMCLK in section .text 115 | (gdb) c 116 | Continuing. 117 | # Give it time to run the init code, then break with Ctrl+C 118 | ^C 119 | Program received signal SIGTRAP, Trace/breakpoint trap. 120 | 0x000046b4 in USCI_A_UART_transmitData (baseAddress=1536, transmitData=97 'a') 121 | at /driverlib/MSP430F5xx_6xx/usci_a_uart.c:146 122 | 146 while(!(HWREG8(baseAddress + OFS_UCAxIFG) & UCTXIFG)) 123 | (gdb) call UCS_getMCLK() 124 | $4 = 24000000 125 | (gdb) print mclk_val 126 | $6 = 13824 127 | # This is likely the result of an overflow 128 | (gdb) print aclk_val 129 | $6 = 32768 130 | ~~~ 131 | 132 | * Loading a program into device RAM from msp430-elf-gdb is possible. 133 | 134 | ~~~ 135 | (gdb) load 136 | Loading section .rodata, size 0x8e lma 0x4400 137 | Loading section .rodata2, size 0x50 lma 0x4490 138 | Loading section .data, size 0x4 lma 0x44e0 139 | Loading section .lowtext, size 0x66 lma 0x44e4 140 | Loading section .text, size 0x111c lma 0x454a 141 | Loading section __interrupt_vector_47, size 0x2 lma 0xffdc 142 | Loading section __interrupt_vector_57, size 0x2 lma 0xfff0 143 | Loading section __reset_vector, size 0x2 lma 0xfffe 144 | Start address 0x44e4, load size 4714 145 | Transfer rate: 4 KB/sec, 392 bytes/write. 146 | 147 | # load may also work 148 | # Reset the device by reconnecting to the target. 149 | # Note that this isn't equivalent to a power on reset. General RAM is not 150 | # cleared. .bss may or may not be cleared (haven't checked). 151 | 152 | (gdb) target remote :55000 153 | A program is being debugged already. Kill it? (y or n) y 154 | Remote debugging using :55000 155 | 0x000044e4 in __crt0_start () 156 | (gdb) 157 | (gdb) 158 | ~~~ 159 | 160 | * `make` can, in principle, be run from within `gdb`. There are probably various other 161 | constraints to run make within gdb, and the usual make from the correct build folder 162 | (root) is probably a safer bet. 163 | 164 | ~~~ 165 | (gdb) make 166 | ~~~ 167 | 168 | * For the sake of convenience, the various map files and symbol tables are 169 | automatically generated by the `ebs CMAKE Platform` file, and can be found alongside 170 | the primary build outputs in their respective build folder. 171 | 172 | 173 | Installing 64-bit libmsp430.so v3.13 174 | ------------------------------------ 175 | 176 | WARNING : Compiling libmsp430.so against recent boost versions is a nightmare. You might find it easier to go with a precompiled libmsp430.so or a binary distribution, or get an earlier version of boost. I suspect it works fine against upto atleast boost 1.62, and the official build is against boost 1.56. These instructions get the binary built against 1.66 and it seems to work, but YMMV. 177 | 178 | * Get slac460y.zip from TI, containing MSP430.DLL v3.13.000.001 Open Source version, 179 | Released 15/05/2018 180 | 181 | 182 | 183 | * According to the install docs, boost with BOOST_THREAD_PATCH is needed. Install 184 | libboost-thread-dev and hope for the best. Building boost itself is a pain. Version 185 | 3.08 also requires libboost-filesystem. (Running apt-get update and upgrade first 186 | is probably a good idea). 187 | 188 | ~~~ 189 | $ sudo apt install libboost-thread-dev 190 | $ sudo apt install libboost-filesystem-dev 191 | $ sudo apt install libusb-1.0-0-dev libudev-dev 192 | ~~~ 193 | 194 | * The v3.11 version has the following additional dependencies, which don't seem to be 195 | listed in the install docs but does cause failure during compile time. Maybe install 196 | them later on once compile fails if you have concerns about installing unnecessary 197 | stuff. 198 | 199 | ~~~ 200 | $ sudo apt install libboost-date-time-dev 201 | $ sudo apt install libboost-chrono-dev 202 | $ sudo apt install libboost-thread-dev 203 | ~~~ 204 | 205 | * For hidapi, required version is 0.8.0-rc1. Though Ubuntu 16.04 version is 206 | also 0.8.0-rc, the makefile needs the .h and .o to be put into the source 207 | tree. So obtain and build the sources instead of mucking around system hidapi. 208 | 209 | ~~~ 210 | $ wget https://github.com/signal11/hidapi/archive/hidapi-0.8.0-rc1.zip 211 | $ unzip hidapi-0.8.0-rc1.ziz 212 | $ cd hidapi-0.8.0-rc1 213 | ~~~ 214 | 215 | * Compile with -fPIC for creating a 64-bit shared object. 216 | 217 | ~~~ 218 | $ ./bootstrap 219 | $ ./configure CFLAGS='-g -O2 -fPIC' 220 | $ make 221 | ~~~ 222 | 223 | * Get libmsp430 sources and extract 224 | 225 | ~~~ 226 | $ unzip slac460y.zip -d MSPDebugStack 227 | $ cd MSPDebugStack 228 | ~~~ 229 | 230 | * Copy the necessary hidapi files to the MSPDebug ThirdParty folder. 231 | - `hidapi/hidapi.h` to `ThirdPary/include` 232 | - `libusb/hid.o` to `ThirdParty/lib64` 233 | 234 | * Edit the Makefile to point to the correct hidapi object. 235 | - Replace `HIDOBJ := $(LIBTHIRD)/hid-libusb.o` with `HIDOBJ := $(LIBTHIRD)/hid.o` 236 | 237 | * The v3.11 version (and later) as shipped does not compile. This has to do with a 238 | licensing issue that was very poorly handled by TI. The fastest way to make the 239 | compile work is to ignore the licensing issue and link against the GPLv3 srecord 240 | project. This can be done by editing `DLL430_v3/src/TI/DLL430/UpdateManagerFet.cpp`, 241 | and uncomment the line 242 | 243 | ~~~ 244 | //#define FPGA_UPDATE 245 | ~~~ 246 | 247 | * There are a number of namespace conflicts that arise from using a recent boost 248 | version with a recent C++ stdlib. See for a discussion. Using the approaches described there, a patch for 249 | slac460y.zip from TI, v3.13.000.001 Open Source, has been put together and can be 250 | found alongside, see resources/patches/slac460y.fixes.patch`. You should be able to 251 | apply this patch to a pristine extraction of slac460y.zip. 252 | 253 | * Run `make` as usual to generate a shared object file, and install the .so. The 254 | STATIC=1 build fails with a problem linking against `boost-filesystems`, so remember 255 | that the generated binary is linked against system boost and will need to be 256 | recompiled if the boost version changes. 257 | 258 | ~~~ 259 | $ make 260 | $ sudo make install 261 | ~~~ 262 | 263 | * `mspdebug` and `tilib` seem to have trouble locating the `libmsp430.so` binary. 264 | One workaround is to add `export LD_PRELOAD="/usr/local/lib/libmsp430.so" to 265 | `~/.bashrc` to make this work. 266 | 267 | Installing python-msp430-tools and using the MSP430 USB BSL 268 | ----------------------------------------------------------- 269 | 270 | MSP430s have built-in bootloaders on their ROM which can be used to write to 271 | their flash. The USB MSP430s, such as the MSP430F5529, around which a launchpad 272 | is also available, make this bootloader available over a HID endpoint using the 273 | USB peripheral. 274 | 275 | The included Python firmware downloader in the USB Developers Pack doesn't 276 | seem to work, and doesn't actually seem to add much value even if it does. 277 | The firmware downloader tool is based on the open-source `python-msp430-tools`, 278 | which can be used directly. 279 | 280 | The tools are available on PyPI at v0.8. 281 | 282 | $ pip install python-msp430-tools 283 | 284 | You can use the version from the repository if the version on pip doesn't work for you. 285 | 286 | $ sudo pip install -e bzr+lp:python-msp430-tools#egg=python-msp430-tools 287 | 288 | Once installed, the tools can be used from the command line. Note that prior 289 | steps are needed to put the MSP430 into the BSL mode. The simplest way to do this 290 | for the USB MSP430s is applying PUR during a reset. Refer to TI documentation for 291 | other options and more detail. Writing to the device looks like : 292 | 293 | sudo python -m msp430.bsl5.hid -i elf -eErw application/firmware-msp430f5529.elf -PVv 294 | 295 | 296 | Further details and command line options are available at 297 | 298 | 299 | Root access (`sudo`) is required on Ubuntu/Linux for the application to obtain 300 | `hidraw` access to the USB device. There are probably some `udev` rules that can 301 | be installed to avoid the need for privilege escalation every time you want to 302 | write to the device. 303 | 304 | ^[To convert this file to `pdf`, use `pandoc README.md -o README.pdf`. See 305 | for further information] 306 | -------------------------------------------------------------------------------- /resources/doc/jquery.smartmenus.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * SmartMenus jQuery Plugin - v1.0.1 - November 1, 2016 3 | * http://www.smartmenus.org/ 4 | * 5 | * Copyright Vasil Dinkov, Vadikom Web Ltd. 6 | * http://vadikom.com 7 | * 8 | * Licensed MIT 9 | */ 10 | 11 | (function(factory) { 12 | if (typeof define === 'function' && define.amd) { 13 | // AMD 14 | define(['jquery'], factory); 15 | } else if (typeof module === 'object' && typeof module.exports === 'object') { 16 | // CommonJS 17 | module.exports = factory(require('jquery')); 18 | } else { 19 | // Global jQuery 20 | factory(jQuery); 21 | } 22 | } (function($) { 23 | 24 | var menuTrees = [], 25 | IE = !!window.createPopup, // detect it for the iframe shim 26 | mouse = false, // optimize for touch by default - we will detect for mouse input 27 | touchEvents = 'ontouchstart' in window, // we use this just to choose between toucn and pointer events, not for touch screen detection 28 | mouseDetectionEnabled = false, 29 | requestAnimationFrame = window.requestAnimationFrame || function(callback) { return setTimeout(callback, 1000 / 60); }, 30 | cancelAnimationFrame = window.cancelAnimationFrame || function(id) { clearTimeout(id); }; 31 | 32 | // Handle detection for mouse input (i.e. desktop browsers, tablets with a mouse, etc.) 33 | function initMouseDetection(disable) { 34 | var eNS = '.smartmenus_mouse'; 35 | if (!mouseDetectionEnabled && !disable) { 36 | // if we get two consecutive mousemoves within 2 pixels from each other and within 300ms, we assume a real mouse/cursor is present 37 | // in practice, this seems like impossible to trick unintentianally with a real mouse and a pretty safe detection on touch devices (even with older browsers that do not support touch events) 38 | var firstTime = true, 39 | lastMove = null; 40 | $(document).bind(getEventsNS([ 41 | ['mousemove', function(e) { 42 | var thisMove = { x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() }; 43 | if (lastMove) { 44 | var deltaX = Math.abs(lastMove.x - thisMove.x), 45 | deltaY = Math.abs(lastMove.y - thisMove.y); 46 | if ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp - lastMove.timeStamp <= 300) { 47 | mouse = true; 48 | // if this is the first check after page load, check if we are not over some item by chance and call the mouseenter handler if yes 49 | if (firstTime) { 50 | var $a = $(e.target).closest('a'); 51 | if ($a.is('a')) { 52 | $.each(menuTrees, function() { 53 | if ($.contains(this.$root[0], $a[0])) { 54 | this.itemEnter({ currentTarget: $a[0] }); 55 | return false; 56 | } 57 | }); 58 | } 59 | firstTime = false; 60 | } 61 | } 62 | } 63 | lastMove = thisMove; 64 | }], 65 | [touchEvents ? 'touchstart' : 'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut', function(e) { 66 | if (isTouchEvent(e.originalEvent)) { 67 | mouse = false; 68 | } 69 | }] 70 | ], eNS)); 71 | mouseDetectionEnabled = true; 72 | } else if (mouseDetectionEnabled && disable) { 73 | $(document).unbind(eNS); 74 | mouseDetectionEnabled = false; 75 | } 76 | } 77 | 78 | function isTouchEvent(e) { 79 | return !/^(4|mouse)$/.test(e.pointerType); 80 | } 81 | 82 | // returns a jQuery bind() ready object 83 | function getEventsNS(defArr, eNS) { 84 | if (!eNS) { 85 | eNS = ''; 86 | } 87 | var obj = {}; 88 | $.each(defArr, function(index, value) { 89 | obj[value[0].split(' ').join(eNS + ' ') + eNS] = value[1]; 90 | }); 91 | return obj; 92 | } 93 | 94 | $.SmartMenus = function(elm, options) { 95 | this.$root = $(elm); 96 | this.opts = options; 97 | this.rootId = ''; // internal 98 | this.accessIdPrefix = ''; 99 | this.$subArrow = null; 100 | this.activatedItems = []; // stores last activated A's for each level 101 | this.visibleSubMenus = []; // stores visible sub menus UL's (might be in no particular order) 102 | this.showTimeout = 0; 103 | this.hideTimeout = 0; 104 | this.scrollTimeout = 0; 105 | this.clickActivated = false; 106 | this.focusActivated = false; 107 | this.zIndexInc = 0; 108 | this.idInc = 0; 109 | this.$firstLink = null; // we'll use these for some tests 110 | this.$firstSub = null; // at runtime so we'll cache them 111 | this.disabled = false; 112 | this.$disableOverlay = null; 113 | this.$touchScrollingSub = null; 114 | this.cssTransforms3d = 'perspective' in elm.style || 'webkitPerspective' in elm.style; 115 | this.wasCollapsible = false; 116 | this.init(); 117 | }; 118 | 119 | $.extend($.SmartMenus, { 120 | hideAll: function() { 121 | $.each(menuTrees, function() { 122 | this.menuHideAll(); 123 | }); 124 | }, 125 | destroy: function() { 126 | while (menuTrees.length) { 127 | menuTrees[0].destroy(); 128 | } 129 | initMouseDetection(true); 130 | }, 131 | prototype: { 132 | init: function(refresh) { 133 | var self = this; 134 | 135 | if (!refresh) { 136 | menuTrees.push(this); 137 | 138 | this.rootId = (new Date().getTime() + Math.random() + '').replace(/\D/g, ''); 139 | this.accessIdPrefix = 'sm-' + this.rootId + '-'; 140 | 141 | if (this.$root.hasClass('sm-rtl')) { 142 | this.opts.rightToLeftSubMenus = true; 143 | } 144 | 145 | // init root (main menu) 146 | var eNS = '.smartmenus'; 147 | this.$root 148 | .data('smartmenus', this) 149 | .attr('data-smartmenus-id', this.rootId) 150 | .dataSM('level', 1) 151 | .bind(getEventsNS([ 152 | ['mouseover focusin', $.proxy(this.rootOver, this)], 153 | ['mouseout focusout', $.proxy(this.rootOut, this)], 154 | ['keydown', $.proxy(this.rootKeyDown, this)] 155 | ], eNS)) 156 | .delegate('a', getEventsNS([ 157 | ['mouseenter', $.proxy(this.itemEnter, this)], 158 | ['mouseleave', $.proxy(this.itemLeave, this)], 159 | ['mousedown', $.proxy(this.itemDown, this)], 160 | ['focus', $.proxy(this.itemFocus, this)], 161 | ['blur', $.proxy(this.itemBlur, this)], 162 | ['click', $.proxy(this.itemClick, this)] 163 | ], eNS)); 164 | 165 | // hide menus on tap or click outside the root UL 166 | eNS += this.rootId; 167 | if (this.opts.hideOnClick) { 168 | $(document).bind(getEventsNS([ 169 | ['touchstart', $.proxy(this.docTouchStart, this)], 170 | ['touchmove', $.proxy(this.docTouchMove, this)], 171 | ['touchend', $.proxy(this.docTouchEnd, this)], 172 | // for Opera Mobile < 11.5, webOS browser, etc. we'll check click too 173 | ['click', $.proxy(this.docClick, this)] 174 | ], eNS)); 175 | } 176 | // hide sub menus on resize 177 | $(window).bind(getEventsNS([['resize orientationchange', $.proxy(this.winResize, this)]], eNS)); 178 | 179 | if (this.opts.subIndicators) { 180 | this.$subArrow = $('').addClass('sub-arrow'); 181 | if (this.opts.subIndicatorsText) { 182 | this.$subArrow.html(this.opts.subIndicatorsText); 183 | } 184 | } 185 | 186 | // make sure mouse detection is enabled 187 | initMouseDetection(); 188 | } 189 | 190 | // init sub menus 191 | this.$firstSub = this.$root.find('ul').each(function() { self.menuInit($(this)); }).eq(0); 192 | 193 | this.$firstLink = this.$root.find('a').eq(0); 194 | 195 | // find current item 196 | if (this.opts.markCurrentItem) { 197 | var reDefaultDoc = /(index|default)\.[^#\?\/]*/i, 198 | reHash = /#.*/, 199 | locHref = window.location.href.replace(reDefaultDoc, ''), 200 | locHrefNoHash = locHref.replace(reHash, ''); 201 | this.$root.find('a').each(function() { 202 | var href = this.href.replace(reDefaultDoc, ''), 203 | $this = $(this); 204 | if (href == locHref || href == locHrefNoHash) { 205 | $this.addClass('current'); 206 | if (self.opts.markCurrentTree) { 207 | $this.parentsUntil('[data-smartmenus-id]', 'ul').each(function() { 208 | $(this).dataSM('parent-a').addClass('current'); 209 | }); 210 | } 211 | } 212 | }); 213 | } 214 | 215 | // save initial state 216 | this.wasCollapsible = this.isCollapsible(); 217 | }, 218 | destroy: function(refresh) { 219 | if (!refresh) { 220 | var eNS = '.smartmenus'; 221 | this.$root 222 | .removeData('smartmenus') 223 | .removeAttr('data-smartmenus-id') 224 | .removeDataSM('level') 225 | .unbind(eNS) 226 | .undelegate(eNS); 227 | eNS += this.rootId; 228 | $(document).unbind(eNS); 229 | $(window).unbind(eNS); 230 | if (this.opts.subIndicators) { 231 | this.$subArrow = null; 232 | } 233 | } 234 | this.menuHideAll(); 235 | var self = this; 236 | this.$root.find('ul').each(function() { 237 | var $this = $(this); 238 | if ($this.dataSM('scroll-arrows')) { 239 | $this.dataSM('scroll-arrows').remove(); 240 | } 241 | if ($this.dataSM('shown-before')) { 242 | if (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth) { 243 | $this.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap'); 244 | } 245 | if ($this.dataSM('scroll-arrows')) { 246 | $this.dataSM('scroll-arrows').remove(); 247 | } 248 | $this.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' }); 249 | } 250 | if (($this.attr('id') || '').indexOf(self.accessIdPrefix) == 0) { 251 | $this.removeAttr('id'); 252 | } 253 | }) 254 | .removeDataSM('in-mega') 255 | .removeDataSM('shown-before') 256 | .removeDataSM('ie-shim') 257 | .removeDataSM('scroll-arrows') 258 | .removeDataSM('parent-a') 259 | .removeDataSM('level') 260 | .removeDataSM('beforefirstshowfired') 261 | .removeAttr('role') 262 | .removeAttr('aria-hidden') 263 | .removeAttr('aria-labelledby') 264 | .removeAttr('aria-expanded'); 265 | this.$root.find('a.has-submenu').each(function() { 266 | var $this = $(this); 267 | if ($this.attr('id').indexOf(self.accessIdPrefix) == 0) { 268 | $this.removeAttr('id'); 269 | } 270 | }) 271 | .removeClass('has-submenu') 272 | .removeDataSM('sub') 273 | .removeAttr('aria-haspopup') 274 | .removeAttr('aria-controls') 275 | .removeAttr('aria-expanded') 276 | .closest('li').removeDataSM('sub'); 277 | if (this.opts.subIndicators) { 278 | this.$root.find('span.sub-arrow').remove(); 279 | } 280 | if (this.opts.markCurrentItem) { 281 | this.$root.find('a.current').removeClass('current'); 282 | } 283 | if (!refresh) { 284 | this.$root = null; 285 | this.$firstLink = null; 286 | this.$firstSub = null; 287 | if (this.$disableOverlay) { 288 | this.$disableOverlay.remove(); 289 | this.$disableOverlay = null; 290 | } 291 | menuTrees.splice($.inArray(this, menuTrees), 1); 292 | } 293 | }, 294 | disable: function(noOverlay) { 295 | if (!this.disabled) { 296 | this.menuHideAll(); 297 | // display overlay over the menu to prevent interaction 298 | if (!noOverlay && !this.opts.isPopup && this.$root.is(':visible')) { 299 | var pos = this.$root.offset(); 300 | this.$disableOverlay = $('
    ').css({ 301 | position: 'absolute', 302 | top: pos.top, 303 | left: pos.left, 304 | width: this.$root.outerWidth(), 305 | height: this.$root.outerHeight(), 306 | zIndex: this.getStartZIndex(true), 307 | opacity: 0 308 | }).appendTo(document.body); 309 | } 310 | this.disabled = true; 311 | } 312 | }, 313 | docClick: function(e) { 314 | if (this.$touchScrollingSub) { 315 | this.$touchScrollingSub = null; 316 | return; 317 | } 318 | // hide on any click outside the menu or on a menu link 319 | if (this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).is('a')) { 320 | this.menuHideAll(); 321 | } 322 | }, 323 | docTouchEnd: function(e) { 324 | if (!this.lastTouch) { 325 | return; 326 | } 327 | if (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) { 328 | if (this.hideTimeout) { 329 | clearTimeout(this.hideTimeout); 330 | this.hideTimeout = 0; 331 | } 332 | // hide with a delay to prevent triggering accidental unwanted click on some page element 333 | var self = this; 334 | this.hideTimeout = setTimeout(function() { self.menuHideAll(); }, 350); 335 | } 336 | this.lastTouch = null; 337 | }, 338 | docTouchMove: function(e) { 339 | if (!this.lastTouch) { 340 | return; 341 | } 342 | var touchPoint = e.originalEvent.touches[0]; 343 | this.lastTouch.x2 = touchPoint.pageX; 344 | this.lastTouch.y2 = touchPoint.pageY; 345 | }, 346 | docTouchStart: function(e) { 347 | var touchPoint = e.originalEvent.touches[0]; 348 | this.lastTouch = { x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target }; 349 | }, 350 | enable: function() { 351 | if (this.disabled) { 352 | if (this.$disableOverlay) { 353 | this.$disableOverlay.remove(); 354 | this.$disableOverlay = null; 355 | } 356 | this.disabled = false; 357 | } 358 | }, 359 | getClosestMenu: function(elm) { 360 | var $closestMenu = $(elm).closest('ul'); 361 | while ($closestMenu.dataSM('in-mega')) { 362 | $closestMenu = $closestMenu.parent().closest('ul'); 363 | } 364 | return $closestMenu[0] || null; 365 | }, 366 | getHeight: function($elm) { 367 | return this.getOffset($elm, true); 368 | }, 369 | // returns precise width/height float values 370 | getOffset: function($elm, height) { 371 | var old; 372 | if ($elm.css('display') == 'none') { 373 | old = { position: $elm[0].style.position, visibility: $elm[0].style.visibility }; 374 | $elm.css({ position: 'absolute', visibility: 'hidden' }).show(); 375 | } 376 | var box = $elm[0].getBoundingClientRect && $elm[0].getBoundingClientRect(), 377 | val = box && (height ? box.height || box.bottom - box.top : box.width || box.right - box.left); 378 | if (!val && val !== 0) { 379 | val = height ? $elm[0].offsetHeight : $elm[0].offsetWidth; 380 | } 381 | if (old) { 382 | $elm.hide().css(old); 383 | } 384 | return val; 385 | }, 386 | getStartZIndex: function(root) { 387 | var zIndex = parseInt(this[root ? '$root' : '$firstSub'].css('z-index')); 388 | if (!root && isNaN(zIndex)) { 389 | zIndex = parseInt(this.$root.css('z-index')); 390 | } 391 | return !isNaN(zIndex) ? zIndex : 1; 392 | }, 393 | getTouchPoint: function(e) { 394 | return e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e; 395 | }, 396 | getViewport: function(height) { 397 | var name = height ? 'Height' : 'Width', 398 | val = document.documentElement['client' + name], 399 | val2 = window['inner' + name]; 400 | if (val2) { 401 | val = Math.min(val, val2); 402 | } 403 | return val; 404 | }, 405 | getViewportHeight: function() { 406 | return this.getViewport(true); 407 | }, 408 | getViewportWidth: function() { 409 | return this.getViewport(); 410 | }, 411 | getWidth: function($elm) { 412 | return this.getOffset($elm); 413 | }, 414 | handleEvents: function() { 415 | return !this.disabled && this.isCSSOn(); 416 | }, 417 | handleItemEvents: function($a) { 418 | return this.handleEvents() && !this.isLinkInMegaMenu($a); 419 | }, 420 | isCollapsible: function() { 421 | return this.$firstSub.css('position') == 'static'; 422 | }, 423 | isCSSOn: function() { 424 | return this.$firstLink.css('display') == 'block'; 425 | }, 426 | isFixed: function() { 427 | var isFixed = this.$root.css('position') == 'fixed'; 428 | if (!isFixed) { 429 | this.$root.parentsUntil('body').each(function() { 430 | if ($(this).css('position') == 'fixed') { 431 | isFixed = true; 432 | return false; 433 | } 434 | }); 435 | } 436 | return isFixed; 437 | }, 438 | isLinkInMegaMenu: function($a) { 439 | return $(this.getClosestMenu($a[0])).hasClass('mega-menu'); 440 | }, 441 | isTouchMode: function() { 442 | return !mouse || this.opts.noMouseOver || this.isCollapsible(); 443 | }, 444 | itemActivate: function($a, focus) { 445 | var $ul = $a.closest('ul'), 446 | level = $ul.dataSM('level'); 447 | // if for some reason the parent item is not activated (e.g. this is an API call to activate the item), activate all parent items first 448 | if (level > 1 && (!this.activatedItems[level - 2] || this.activatedItems[level - 2][0] != $ul.dataSM('parent-a')[0])) { 449 | var self = this; 450 | $($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function() { 451 | self.itemActivate($(this).dataSM('parent-a')); 452 | }); 453 | } 454 | // hide any visible deeper level sub menus 455 | if (!this.isCollapsible() || focus) { 456 | this.menuHideSubMenus(!this.activatedItems[level - 1] || this.activatedItems[level - 1][0] != $a[0] ? level - 1 : level); 457 | } 458 | // save new active item for this level 459 | this.activatedItems[level - 1] = $a; 460 | if (this.$root.triggerHandler('activate.smapi', $a[0]) === false) { 461 | return; 462 | } 463 | // show the sub menu if this item has one 464 | var $sub = $a.dataSM('sub'); 465 | if ($sub && (this.isTouchMode() || (!this.opts.showOnClick || this.clickActivated))) { 466 | this.menuShow($sub); 467 | } 468 | }, 469 | itemBlur: function(e) { 470 | var $a = $(e.currentTarget); 471 | if (!this.handleItemEvents($a)) { 472 | return; 473 | } 474 | this.$root.triggerHandler('blur.smapi', $a[0]); 475 | }, 476 | itemClick: function(e) { 477 | var $a = $(e.currentTarget); 478 | if (!this.handleItemEvents($a)) { 479 | return; 480 | } 481 | if (this.$touchScrollingSub && this.$touchScrollingSub[0] == $a.closest('ul')[0]) { 482 | this.$touchScrollingSub = null; 483 | e.stopPropagation(); 484 | return false; 485 | } 486 | if (this.$root.triggerHandler('click.smapi', $a[0]) === false) { 487 | return false; 488 | } 489 | var subArrowClicked = $(e.target).is('span.sub-arrow'), 490 | $sub = $a.dataSM('sub'), 491 | firstLevelSub = $sub ? $sub.dataSM('level') == 2 : false; 492 | // if the sub is not visible 493 | if ($sub && !$sub.is(':visible')) { 494 | if (this.opts.showOnClick && firstLevelSub) { 495 | this.clickActivated = true; 496 | } 497 | // try to activate the item and show the sub 498 | this.itemActivate($a); 499 | // if "itemActivate" showed the sub, prevent the click so that the link is not loaded 500 | // if it couldn't show it, then the sub menus are disabled with an !important declaration (e.g. via mobile styles) so let the link get loaded 501 | if ($sub.is(':visible')) { 502 | this.focusActivated = true; 503 | return false; 504 | } 505 | } else if (this.isCollapsible() && subArrowClicked) { 506 | this.itemActivate($a); 507 | this.menuHide($sub); 508 | return false; 509 | } 510 | if (this.opts.showOnClick && firstLevelSub || $a.hasClass('disabled') || this.$root.triggerHandler('select.smapi', $a[0]) === false) { 511 | return false; 512 | } 513 | }, 514 | itemDown: function(e) { 515 | var $a = $(e.currentTarget); 516 | if (!this.handleItemEvents($a)) { 517 | return; 518 | } 519 | $a.dataSM('mousedown', true); 520 | }, 521 | itemEnter: function(e) { 522 | var $a = $(e.currentTarget); 523 | if (!this.handleItemEvents($a)) { 524 | return; 525 | } 526 | if (!this.isTouchMode()) { 527 | if (this.showTimeout) { 528 | clearTimeout(this.showTimeout); 529 | this.showTimeout = 0; 530 | } 531 | var self = this; 532 | this.showTimeout = setTimeout(function() { self.itemActivate($a); }, this.opts.showOnClick && $a.closest('ul').dataSM('level') == 1 ? 1 : this.opts.showTimeout); 533 | } 534 | this.$root.triggerHandler('mouseenter.smapi', $a[0]); 535 | }, 536 | itemFocus: function(e) { 537 | var $a = $(e.currentTarget); 538 | if (!this.handleItemEvents($a)) { 539 | return; 540 | } 541 | // fix (the mousedown check): in some browsers a tap/click produces consecutive focus + click events so we don't need to activate the item on focus 542 | if (this.focusActivated && (!this.isTouchMode() || !$a.dataSM('mousedown')) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length - 1][0] != $a[0])) { 543 | this.itemActivate($a, true); 544 | } 545 | this.$root.triggerHandler('focus.smapi', $a[0]); 546 | }, 547 | itemLeave: function(e) { 548 | var $a = $(e.currentTarget); 549 | if (!this.handleItemEvents($a)) { 550 | return; 551 | } 552 | if (!this.isTouchMode()) { 553 | $a[0].blur(); 554 | if (this.showTimeout) { 555 | clearTimeout(this.showTimeout); 556 | this.showTimeout = 0; 557 | } 558 | } 559 | $a.removeDataSM('mousedown'); 560 | this.$root.triggerHandler('mouseleave.smapi', $a[0]); 561 | }, 562 | menuHide: function($sub) { 563 | if (this.$root.triggerHandler('beforehide.smapi', $sub[0]) === false) { 564 | return; 565 | } 566 | $sub.stop(true, true); 567 | if ($sub.css('display') != 'none') { 568 | var complete = function() { 569 | // unset z-index 570 | $sub.css('z-index', ''); 571 | }; 572 | // if sub is collapsible (mobile view) 573 | if (this.isCollapsible()) { 574 | if (this.opts.collapsibleHideFunction) { 575 | this.opts.collapsibleHideFunction.call(this, $sub, complete); 576 | } else { 577 | $sub.hide(this.opts.collapsibleHideDuration, complete); 578 | } 579 | } else { 580 | if (this.opts.hideFunction) { 581 | this.opts.hideFunction.call(this, $sub, complete); 582 | } else { 583 | $sub.hide(this.opts.hideDuration, complete); 584 | } 585 | } 586 | // remove IE iframe shim 587 | if ($sub.dataSM('ie-shim')) { 588 | $sub.dataSM('ie-shim').remove().css({ '-webkit-transform': '', transform: '' }); 589 | } 590 | // deactivate scrolling if it is activated for this sub 591 | if ($sub.dataSM('scroll')) { 592 | this.menuScrollStop($sub); 593 | $sub.css({ 'touch-action': '', '-ms-touch-action': '', '-webkit-transform': '', transform: '' }) 594 | .unbind('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide(); 595 | } 596 | // unhighlight parent item + accessibility 597 | $sub.dataSM('parent-a').removeClass('highlighted').attr('aria-expanded', 'false'); 598 | $sub.attr({ 599 | 'aria-expanded': 'false', 600 | 'aria-hidden': 'true' 601 | }); 602 | var level = $sub.dataSM('level'); 603 | this.activatedItems.splice(level - 1, 1); 604 | this.visibleSubMenus.splice($.inArray($sub, this.visibleSubMenus), 1); 605 | this.$root.triggerHandler('hide.smapi', $sub[0]); 606 | } 607 | }, 608 | menuHideAll: function() { 609 | if (this.showTimeout) { 610 | clearTimeout(this.showTimeout); 611 | this.showTimeout = 0; 612 | } 613 | // hide all subs 614 | // if it's a popup, this.visibleSubMenus[0] is the root UL 615 | var level = this.opts.isPopup ? 1 : 0; 616 | for (var i = this.visibleSubMenus.length - 1; i >= level; i--) { 617 | this.menuHide(this.visibleSubMenus[i]); 618 | } 619 | // hide root if it's popup 620 | if (this.opts.isPopup) { 621 | this.$root.stop(true, true); 622 | if (this.$root.is(':visible')) { 623 | if (this.opts.hideFunction) { 624 | this.opts.hideFunction.call(this, this.$root); 625 | } else { 626 | this.$root.hide(this.opts.hideDuration); 627 | } 628 | // remove IE iframe shim 629 | if (this.$root.dataSM('ie-shim')) { 630 | this.$root.dataSM('ie-shim').remove(); 631 | } 632 | } 633 | } 634 | this.activatedItems = []; 635 | this.visibleSubMenus = []; 636 | this.clickActivated = false; 637 | this.focusActivated = false; 638 | // reset z-index increment 639 | this.zIndexInc = 0; 640 | this.$root.triggerHandler('hideAll.smapi'); 641 | }, 642 | menuHideSubMenus: function(level) { 643 | for (var i = this.activatedItems.length - 1; i >= level; i--) { 644 | var $sub = this.activatedItems[i].dataSM('sub'); 645 | if ($sub) { 646 | this.menuHide($sub); 647 | } 648 | } 649 | }, 650 | menuIframeShim: function($ul) { 651 | // create iframe shim for the menu 652 | if (IE && this.opts.overlapControlsInIE && !$ul.dataSM('ie-shim')) { 653 | $ul.dataSM('ie-shim', $('