Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .entry
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_SYSTEM_ENTRY_DIR = "./booting.c"
28 changes: 28 additions & 0 deletions booting.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// File: twelve_biubiu.c
// Permission: CN-2082-2
// Author: Li.YiYi
// Dept: PE-362, UG
// Origin: TI-352132
// 春节十二响启动器 biu biu biu!

#include "engine_rt.h"
#include "engine_macros.h"
#include "twelve_biubiu.h"

int main() {
init();
// 允许误差10秒以内
if (unix_time() < make_unix_time(2082, 1, 28, 23, 59, 60-10)) return ERR_ENGIN_ENV;
int signal = engine_check_init();
// after compile and before real run
if(ENGINE_FAIL(signal)) {
return signal;
}
engine_processing(processing);
signal = engine_shutdown(final);
// 异常关闭
if(ENGINE_FAIL(signal)) {
return signal;
}
return ENGINE_SUCCESS;
}
19 changes: 13 additions & 6 deletions twelve_biubiu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@

#env "planet_engine"

#include "twelve_biubiu.h"
#include "engine_rt.h"
#include "engine_macros.h"

int init() {
set_engine_number_mask(ENGINE_ALL);
set_engine_number_mask(ENGINE_EQUATOR_ALL);
set_funeral_level(FUNERAL_FULL);
// 允许误差10秒以内
if (unix_time() < make_unix_time(2082, 1, 28, 23, 59, 60-10)) return ERR_ENGIN_ENV;
return engine_check_init(); // after compile and before real run
}
int main() {

int processing(int32_t engineStatus) {
if(ENGINE_FAIL(engineStatus)) {
return engineStatus;
}
set_curve(CURVE_NATURAL); // 自然曲线耗费燃料最少
for (int i :range(0, 12, 1)) {
engine_start();
Expand All @@ -26,6 +31,8 @@ int main() {
}
return 0;
}
int final() {

int final(int32_t lastError) {
engine_ensure_shutdown();
return lastError;
}
10 changes: 10 additions & 0 deletions twelve_biubiu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// File: twelve_biubiu.h
// Permission: CN-2082-2
// Author: Li.YiYi
// Dept: PE-362, UG
// Origin: TI-352132
// 春节十二响 biu biu biu!

extern int init()
extern int processing(int32_t);
extern int final(int32_t);