This file contains hidden or 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
| #if !ASM_SIZE_HACKS | |
| // 这种方式简单直观,但会占用额外的指令空间(如加载全局变量地址的指令)。 | |
| mpu_hw_t *mpu_on_arm = mpu_hw; | |
| #else | |
| mpu_hw_t *mpu_on_arm; | |
| pico_default_asm_volatile( | |
| "ldr %[mpu_on_arm], [%[zero],%[_CPACR_OFFSET]]\n" | |
| "adds %[mpu_on_arm], %[REG_DIFF]\n" | |
| : [mpu_on_arm] "=l" (mpu_on_arm) |
This file contains hidden or 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 <stdlib.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <sys/ioctl.h> | |
| #include <sys/stat.h> | |
| #include <sys/types.h> | |
| #include <linux/fs.h> | |
| #include <errno.h> |
This file contains hidden or 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
| import subprocess | |
| import sys | |
| import time | |
| def run_cmd(cmd): | |
| p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| out, err = p.communicate() | |
| if p.returncode != 0: | |
| return "", err.decode(errors="ignore").strip() | |
| return out.decode(errors="ignore"), "" |
This file contains hidden or 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
| set environment LD_LIBRARY_PATH /usr/local/apr/lib/ |
This file contains hidden or 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
| #ifndef _object_h | |
| #define _object_h | |
| typedef enum { | |
| NORTH, SOUTH, EAST, WEST | |
| } Direction; | |
| typedef struct { | |
| char *description; | |
| int (*init)(void *self); |
This file contains hidden or 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
| #ifndef DEBUG_H | |
| #define DEBUG_H | |
| #ifndef DEBUG_H | |
| #define DEBUG_H | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #ifdef NDEBUG |
This file contains hidden or 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
| if [ "${CONFIG_CAMERA_SENSOR}" = "BF2257" ]; then | |
| local snippet_path=${basedir_amp}/products/${opt_amp_profile}/BF2257_sensors.xml | |
| if [ -f "${snippet_path}" ]; then | |
| awk -v snip="${snippet_path}" ' | |
| BEGIN{replacing=0} | |
| /<Sensors[[:space:]][^>]*>/{replacing=1; while((getline line < snip)>0) print line; next} | |
| replacing && /<\/Sensors>/{replacing=0; next} | |
| {if(!replacing) print} | |
| ' "${hw_xml}" > /tmp/berlin_config_hw.new && mv /tmp/berlin_config_hw.new "${hw_xml}" | |
| fi |
This file contains hidden or 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
| $(objects): %: $(BUILD_DIR)/$(%_BIN) | |
| %_NAME = % | |
| %_OBJ_DIR = $(BUILD_DIR)/obj_dir/$% | |
| %_BIN= $(BUILD_DIR)/$(%_NAME) | |
| %_NXDC_FILES = constr/%.nxdc | |
| %_SRC_AUTO_BIND = $(abspath $(BUILD_DIR)/auto_bind_%.cpp) | |
| $(%_SRC_AUTO_BIND): $(%_NXDC_FILES) | |
| python3 $(NVBOARD_HOME)/scripts/auto_pin_bind.py $^ $@ |