Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picsimlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
picsimlab
Commits
1e9b2e6d
Commit
1e9b2e6d
authored
Apr 06, 2024
by
lcgamboa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Fix gpboard simulation clock speed.
parent
829fff56
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
11 deletions
+14
-11
VERSION
VERSION
+1
-1
src/boards/board_gpboard.cc
src/boards/board_gpboard.cc
+3
-4
src/boards/bridge_gpsim.cc
src/boards/bridge_gpsim.cc
+5
-4
src/boards/bsim_gpsim.cc
src/boards/bsim_gpsim.cc
+2
-2
src/lib/oscilloscope.cc
src/lib/oscilloscope.cc
+3
-0
No files found.
VERSION
View file @
1e9b2e6d
...
...
@@ -2,5 +2,5 @@ PACKAGE=picsimlab
MAINVER=0
MINORVER=9
VERSION=0.9.2
DATE=240
324
DATE=240
406
VERSION_STABLE=0.9.1
src/boards/board_gpboard.cc
View file @
1e9b2e6d
...
...
@@ -273,13 +273,12 @@ void cboard_gpboard::Draw(void) {
}
void
cboard_gpboard
::
Run_CPU
(
void
)
{
int
i
;
long
int
i
;
// int j;
unsigned
char
pi
;
unsigned
int
alm
[
64
];
const
int
pinc
=
MGetPinCount
();
// const int JUMPSTEPS = Window1.GetJUMPSTEPS ();
// //number of steps skipped
const
long
int
NSTEP
=
PICSimLab
.
GetNSTEP
();
// number of steps in 100ms
const
float
RNSTEP
=
200.0
*
pinc
/
NSTEP
;
...
...
@@ -294,7 +293,7 @@ void cboard_gpboard::Run_CPU(void) {
// j = JUMPSTEPS; //step counter
pi
=
0
;
if
(
PICSimLab
.
GetMcuPwr
())
// if powered
for
(
i
=
0
;
i
<
PICSimLab
.
GetNSTEP
()
;
i
++
)
// repeat for number of steps in 100ms
for
(
i
=
0
;
i
<
NSTEP
;
i
++
)
// repeat for number of steps in 100ms
{
/*
if (j >= JUMPSTEPS)//if number of step is bigger
...
...
src/boards/bridge_gpsim.cc
View file @
1e9b2e6d
...
...
@@ -51,7 +51,10 @@ unsigned char bridge_gpsim_get_pin_count(void) {
}
const
char
*
bridge_gpsim_get_pin_name
(
int
pin
)
{
if
(
gpic
)
{
return
gpic
->
get_pin_name
(
pin
).
c_str
();
}
return
"error"
;
}
unsigned
char
bridge_gpsim_get_pin_value
(
int
pin
)
{
...
...
@@ -107,9 +110,7 @@ void bridge_gpsim_set_apin_value(int pin, float value) {
void
bridge_gpsim_step
(
void
)
{
gpic
->
step_cycle
();
if
(
gpic
->
mCurrentPhase
==
((
ClockPhase
*
)
gpic
->
mExecute2ndHalf
))
{
gpic
->
step_cycle
();
}
bp
.
clear_halt
();
}
void
bridge_gpsim_end
(
void
)
{
...
...
src/boards/bsim_gpsim.cc
View file @
1e9b2e6d
...
...
@@ -83,7 +83,7 @@ void bsim_gpsim::MSetSerial(const char* port) {
void
bsim_gpsim
::
MSetFreq
(
float
freq_
)
{
freq
=
freq_
;
bridge_gpsim_set_frequency
(
freq
);
TimerUpdateFrequency
(
freq
);
TimerUpdateFrequency
(
freq
/
4.0
);
}
float
bsim_gpsim
::
MGetFreq
(
void
)
{
...
...
@@ -99,7 +99,7 @@ void bsim_gpsim::MSetSerial(const char* port) {
}
float
bsim_gpsim
::
MGetInstClockFreq
(
void
)
{
return
freq
;
return
freq
/
4.0
;
}
int
bsim_gpsim
::
CpuInitialized
(
void
)
{
...
...
src/lib/oscilloscope.cc
View file @
1e9b2e6d
...
...
@@ -379,6 +379,8 @@ void COscilloscope::ReadPreferences(char* name, char* value) {
SetMeasure
(
i
,
measures
[
i
]);
}
}
SetBaseTimer
();
}
std
::
vector
<
std
::
string
>
COscilloscope
::
WritePreferencesList
(
void
)
{
...
...
@@ -569,6 +571,7 @@ void COscilloscope::ReadPreferencesList(std::vector<std::string>& pl) {
// osc_ch2
WindowCmd
(
PW_MAIN
,
"combo3"
,
PWA_COMBOSETTEXT
,
tokens
[
9
]);
SetChannelPin
(
1
,
atoi
(
tokens
[
9
])
-
1
);
SetBaseTimer
();
}
void
COscilloscope
::
SetBaseTimer
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment