1
0
Fork 0
GEX port to STM32F072. This is currently the main port.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
gex-f072/fix_cube_mf.php

24 linhas
642 B

#!/usr/bin/php
<?php
$t = file_get_contents('Makefile');
{
$t = str_replace("BINPATH = \r\n", "BINPATH = /usr/bin\r\n", $t);
$t = preg_replace_callback('/C_SOURCES =.*?\r\n\r\n/s', function($m) {
$x = trim($m[0]);
$lines = array_map('trim', explode('\\', $x));
$lines = array_slice($lines, 1);
$lines = array_unique($lines);
$t2 = "C_SOURCES = \\\r\n" . implode(" \\\r\n", $lines);
return $t2."\r\n\r\n";
}, $t);
}
file_put_contents('Makefile', $t);
$t = file_get_contents("Src/freertos.c");
{
$t = str_replace('__weak void', 'void __attribute__((weak))', $t);
}
file_put_contents("Src/freertos.c", $t);