This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
// log 2 - with ceil rounding | |
int32_t log2_uint32 (uint32_t u) | |
{ | |
if (u == 0) { return INT32_MIN; } | |
return ((int32_t)31 - (int32_t)__builtin_clz(u)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# cl2000 - Toolchain File | |
# F. Zahn - 2018 | |
############################################################################### | |
#set this path according to your needs | |
set(CGT_TOOLCHAIN_DIR "C:/your/path/to/the/toolchain") | |
# set target system | |
set(CMAKE_SYSTEM_NAME Generic) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a file named options.cmake and populate with valid paths assigned to the following: | |
# | |
# set(CG_TOOL_ROOT "/opt/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS") | |
# set(DEVICE_SUPPORT_ROOT "/home/asdf/controlSUITE/device_support/F2807x/v210") | |
# | |
# Then do: | |
# mkdir build && cd build | |
# cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-ti-c2000.cmake .. | |
# make |