我已经运行了 Azure Pipeline。现在,我想仅当运行时某个条件成立时才执行一系列步骤。
例子
steps:
- template: steps_checkout.yml
# some more steps here
- bash: |
if [ some condition ]; then
echo "##vso[task.setVariable variable=rebuild_lib]false"
echo "Did set rebuild_lib to false"
fi
- if eq( variables.rebuild_lib, true) ):
- template: steps_lib_build.yml
Run Code Online (Sandbox Code Playgroud)
该行if eq( variables.rebuild_lib, true) )不起作用,因为它不是正确的条件语法。我可以用
${{ if eq( parameters.something, true ) }}
Run Code Online (Sandbox Code Playgroud)
但这需要在运行时知道。根据https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops
,表达式也可以$[ if eq(variables.rebuild_lib), true]在运行时进行评估,但是使用这个,我得到
Unexpected value '$[ if eq( variables.rebuild_lib, true) ) ]'
Run Code Online (Sandbox Code Playgroud)
似乎 yml 不能在运行时以这种方式修改。
那么我如何决定在运行时使用模板呢?
我可以想象将变量作为参数传递给下一个模板adapter.yml。然后,该模板adapter.yml获取变量作为参数,并可以使用${{}}表达式,并再次使用下一个模板steps_lib_build.yml...但仅为此创建模板似乎不知何故...解决方法。
还使用类似的东西
- template: …Run Code Online (Sandbox Code Playgroud) 我正在研究BLE设备的固件,需要定义一个外观值.现在,我选择了"通用计算机".但是,外观值的完整列表https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml 具有一些可能更合适的值.在Windows 10中,"通用计算机"显示为桌面PC的图标.是否有可用资源允许我查看任何/所有支持的外观值的图标?我想避免多次编译,加载和浏览循环只是为了观察图标.
我只是不明白 Git 的帮助页面。那么会发生什么或者有什么区别?
假设我有一个带有子模块 B 的 Git 项目 A。子模块 B 确实有一个子模块 C。克隆存储库后,A 指向 B 的特定提交。B 指向 C 的特定提交。
如果我在 AI 里面去 B
cd B
Run Code Online (Sandbox Code Playgroud)
现在我输入
git submodule update --remote
Run Code Online (Sandbox Code Playgroud)
或者
git submodule update
Run Code Online (Sandbox Code Playgroud)
有什么不同?假设远程服务器的 A、B 和 C 确实有变化。
我想使用“git submodule update --remote”会保留对特定版本的 C 的引用。是否在不--remote更新到最新版本的 C 的情况下使用它?
我正在使用 stm32f3 发现板和来自 CubeMX 的 HAL。我正在尝试在 ADC4 上使用 2 个 ADC 通道。我在循环模式下配置了 DMA。在 main 中的主循环之前,我调用:
HAL_ADC_Start_DMA(&hadc4, DMA_adc4_buffer, 16);
Run Code Online (Sandbox Code Playgroud)
我实现了功能HAL_ADC_ConvHalfCpltCallback和HAL_ADC_ConvCpltCallback. 现在奇怪的部分HAL_ADC_ConvHalfCpltCallback是:定期调用,HAL_ADC_ConvCpltCallback不是。
它告诉我,带有 DMA 传输的 ADC 运行良好。但是为什么不调用传输竞争回调?如果我用HAL_ADC_Start_IT中断函数启动ADC ,但那不是我想要的。
HAL_DMA_IRQHandler在 ST HAL 中放置断点也表明回调从未被调用。
为了完整起见,这里部分 ADC4_Init 函数:
/**Common config
*/
hadc4.Instance = ADC4;
hadc4.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;
hadc4.Init.Resolution = ADC_RESOLUTION_12B;
hadc4.Init.ScanConvMode = ADC_SCAN_ENABLE;
hadc4.Init.ContinuousConvMode = ENABLE;
hadc4.Init.DiscontinuousConvMode = DISABLE;
hadc4.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc4.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc4.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc4.Init.NbrOfConversion = 2;
hadc4.Init.DMAContinuousRequests = ENABLE; …Run Code Online (Sandbox Code Playgroud) 在 bluetooth.org 上,我看到一个 BLE 特性可以有多个字段。我现在搜索了一段时间,但没有得到有关字节顺序的答案。
例如这个特性:https : //www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gatt.service_changed.xml
它有两个字段。“受影响的属性处理范围的开始”是较高的 16 位还是较低的?
问候马兹