mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
5e6892b6d9
commit
67eb699d51
|
@ -276,5 +276,5 @@ int getRusEfiVersion(void) {
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] == 0)
|
if (UNUSED_CCM_SIZE[0] == 0)
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
return 20150302;
|
return 20150303;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,12 @@ void updateAndSet(State64 *state, uint32_t value) {
|
||||||
state->lowBits = value;
|
state->lowBits = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
uint64_t Overflow64Counter::update(uint32_t value) {
|
uint64_t Overflow64Counter::update(uint32_t value) {
|
||||||
updateAndSet(&state, value);
|
updateAndSet(&state, value);
|
||||||
return state.highBits + state.lowBits;
|
return state.highBits + state.lowBits;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// todo: make this a macro? always inline?
|
// todo: make this a macro? always inline?
|
||||||
uint64_t Overflow64Counter::get() {
|
uint64_t Overflow64Counter::get() {
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
#define EFILIB2_H_
|
#define EFILIB2_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
// todo: would probably be better to keep the high bits as 32 bit field to be sure
|
||||||
volatile uint64_t highBits;
|
volatile uint64_t highBits;
|
||||||
volatile uint32_t lowBits;
|
volatile uint32_t lowBits;
|
||||||
} State64;
|
} State64;
|
||||||
|
@ -23,7 +25,9 @@ class Overflow64Counter
|
||||||
Overflow64Counter();
|
Overflow64Counter();
|
||||||
|
|
||||||
uint64_t get();
|
uint64_t get();
|
||||||
|
#if EFI_UNIT_TEST
|
||||||
uint64_t update(uint32_t value);
|
uint64_t update(uint32_t value);
|
||||||
|
#endif
|
||||||
|
|
||||||
State64 state;
|
State64 state;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue