Skip to content

Commit 3ce10cf

Browse files
authored
Merge pull request #4745 from BsAtHome/hal64_boss_plc
hal: Update to 64-bit clean operation and accesses
2 parents f4e6146 + 1aa9607 commit 3ce10cf

1 file changed

Lines changed: 80 additions & 80 deletions

File tree

‎src/hal/components/boss_plc.c‎

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,74 @@
1414
* the component id number and is formatted as "%d".
1515
*
1616
* Pins (former parameters):
17-
* u32 boss_plc.<id>.amp-ready-delay
18-
* u32 boss_plc.<id>.brake-on-delay
19-
* u32 boss_plc.<id>.brake-off-delay
20-
* u32 boss_plc.<id>.spindle-lo-to-hi
21-
* float boss_plc.<id>.jog-scale-0
22-
* float boss_plc.<id>.jog-scale-1
23-
* float boss_plc.<id>.jog-scale-2
17+
* uint boss_plc.<id>.amp-ready-delay
18+
* uint boss_plc.<id>.brake-on-delay
19+
* uint boss_plc.<id>.brake-off-delay
20+
* uint boss_plc.<id>.spindle-lo-to-hi
21+
* real boss_plc.<id>.jog-scale-0
22+
* real boss_plc.<id>.jog-scale-1
23+
* real boss_plc.<id>.jog-scale-2
2424
*
2525
* Pins:
26-
* bit boss_plc.<id>.cycle-start-in
27-
* bit boss_plc.<id>.cycle-hold-in
28-
* bit boss_plc.<id>.feed-hold-out
29-
* float boss_plc.<id>.adaptive-feed-in
30-
* float boss_plc.<id>.adaptive-feed-out
31-
* bit boss_plc.<id>.tool-change-in
32-
* bit boss_plc.<id>.tool-changed-out
33-
* bit boss_plc.<id>.wait-user-out
34-
* bit boss_plc.<id>.mist-on-in
35-
* bit boss_plc.<id>.mist-on-out
36-
* bit boss_plc.<id>.flood-on-in
37-
* bit boss_plc.<id>.flood-on-out
26+
* bool boss_plc.<id>.cycle-start-in
27+
* bool boss_plc.<id>.cycle-hold-in
28+
* bool boss_plc.<id>.feed-hold-out
29+
* real boss_plc.<id>.adaptive-feed-in
30+
* real boss_plc.<id>.adaptive-feed-out
31+
* bool boss_plc.<id>.tool-change-in
32+
* bool boss_plc.<id>.tool-changed-out
33+
* bool boss_plc.<id>.wait-user-out
34+
* bool boss_plc.<id>.mist-on-in
35+
* bool boss_plc.<id>.mist-on-out
36+
* bool boss_plc.<id>.flood-on-in
37+
* bool boss_plc.<id>.flood-on-out
3838
*
39-
* bit boss_plc.<id>.limit-override-in
40-
* bit boss_plc.<id>.limit-active-out
41-
* float boss_plc.<id>.x-position-in
42-
* bit boss_plc.<id>.x-jog-en-in
43-
* bit boss_plc.<id>.x-limit-in
44-
* bit boss_plc.<id>.x-limit-pos-out
45-
* bit boss_plc.<id>.x-limit-neg-out
46-
* float boss_plc.<id>.y-position-in
47-
* bit boss_plc.<id>.y-jog-en-in
48-
* bit boss_plc.<id>.y-limit-in
49-
* bit boss_plc.<id>.y-limit-pos-out
50-
* bit boss_plc.<id>.y-limit-neg-out
51-
* bit boss_plc.<id>.z-jog-en-in
52-
* bit boss_plc.<id>.z-limit-pos-in
53-
* bit boss_plc.<id>.z-limit-neg-in
54-
* bit boss_plc.<id>.z-limit-pos-out
55-
* bit boss_plc.<id>.z-limit-neg-out
39+
* bool boss_plc.<id>.limit-override-in
40+
* bool boss_plc.<id>.limit-active-out
41+
* real boss_plc.<id>.x-position-in
42+
* bool boss_plc.<id>.x-jog-en-in
43+
* bool boss_plc.<id>.x-limit-in
44+
* bool boss_plc.<id>.x-limit-pos-out
45+
* bool boss_plc.<id>.x-limit-neg-out
46+
* real boss_plc.<id>.y-position-in
47+
* bool boss_plc.<id>.y-jog-en-in
48+
* bool boss_plc.<id>.y-limit-in
49+
* bool boss_plc.<id>.y-limit-pos-out
50+
* bool boss_plc.<id>.y-limit-neg-out
51+
* bool boss_plc.<id>.z-jog-en-in
52+
* bool boss_plc.<id>.z-limit-pos-in
53+
* bool boss_plc.<id>.z-limit-neg-in
54+
* bool boss_plc.<id>.z-limit-pos-out
55+
* bool boss_plc.<id>.z-limit-neg-out
5656
*
57-
* bit boss_plc.<id>.x-amp-enable-in
58-
* bit boss_plc.<id>.x-amp-ready-in
59-
* bit boss_plc.<id>.x-amp-fault-out
60-
* bit boss_plc.<id>.y-amp-enable-in
61-
* bit boss_plc.<id>.y-amp-ready-in
62-
* bit boss_plc.<id>.y-amp-fault-out
63-
* bit boss_plc.<id>.z-amp-enable-in
64-
* bit boss_plc.<id>.z-amp-ready-in
65-
* bit boss_plc.<id>.z-amp-fault-out
66-
* bit boss_plc.<id>.a-amp-enable-in
67-
* bit boss_plc.<id>.a-amp-ready-in
68-
* bit boss_plc.<id>.a-amp-fault-out
57+
* bool boss_plc.<id>.x-amp-enable-in
58+
* bool boss_plc.<id>.x-amp-ready-in
59+
* bool boss_plc.<id>.x-amp-fault-out
60+
* bool boss_plc.<id>.y-amp-enable-in
61+
* bool boss_plc.<id>.y-amp-ready-in
62+
* bool boss_plc.<id>.y-amp-fault-out
63+
* bool boss_plc.<id>.z-amp-enable-in
64+
* bool boss_plc.<id>.z-amp-ready-in
65+
* bool boss_plc.<id>.z-amp-fault-out
66+
* bool boss_plc.<id>.a-amp-enable-in
67+
* bool boss_plc.<id>.a-amp-ready-in
68+
* bool boss_plc.<id>.a-amp-fault-out
6969
*
70-
* float boss_plc.<id>.spindle-speed-in
71-
* bit boss_plc.<id>.spindle-is-on-in
72-
* bit boss_plc.<id>.spindle-fwd-out
73-
* bit boss_plc.<id>.spindle-rev-out
74-
* bit boss_plc.<id>.spindle-inc-in
75-
* bit boss_plc.<id>.spindle-dec-in
76-
* bit boss_plc.<id>.spindle-inc-out
77-
* bit boss_plc.<id>.spindle-dec-out
78-
* bit boss_plc.<id>.brake-en-in
79-
* bit boss_plc.<id>.brake-en-out
70+
* real boss_plc.<id>.spindle-speed-in
71+
* bool boss_plc.<id>.spindle-is-on-in
72+
* bool boss_plc.<id>.spindle-fwd-out
73+
* bool boss_plc.<id>.spindle-rev-out
74+
* bool boss_plc.<id>.spindle-inc-in
75+
* bool boss_plc.<id>.spindle-dec-in
76+
* bool boss_plc.<id>.spindle-inc-out
77+
* bool boss_plc.<id>.spindle-dec-out
78+
* bool boss_plc.<id>.brake-en-in
79+
* bool boss_plc.<id>.brake-en-out
8080
*
81-
* bit boss_plc.<id>.jog-sel-in-0
82-
* bit boss_plc.<id>.jog-sel-in-1
83-
* bit boss_plc.<id>.jog-sel-in-2
84-
* bit boss_plc.<id>.jog-scale-out
81+
* bool boss_plc.<id>.jog-sel-in-0
82+
* bool boss_plc.<id>.jog-sel-in-1
83+
* bool boss_plc.<id>.jog-sel-in-2
84+
* bool boss_plc.<id>.jog-scale-out
8585
*
8686
* Functions:
8787
* void boss_plc.<id>.refresh
@@ -153,8 +153,8 @@ typedef struct {
153153
// Private data.
154154
BOOL enabled;
155155
rtapi_u32 nSec;
156-
rtapi_u32 count;
157-
rtapi_u32 timeout;
156+
rtapi_uint count;
157+
rtapi_uint timeout;
158158
TIMER_ROUTINE pTimeout;
159159
void *pArgs;
160160
TimerMode mode;
@@ -165,7 +165,7 @@ static void Timer_Enable(Timer *this, TimerMode mode);
165165
static void Timer_Disable(Timer *this);
166166
static BOOL Timer_IsEnabled(Timer *this);
167167
static void Timer_Update(Timer *this, long period);
168-
static void Timer_SetTimeout(Timer *this, rtapi_u32 timeout);
168+
static void Timer_SetTimeout(Timer *this, rtapi_uint timeout);
169169
#if 0
170170
static void Timer_SetCallback(Timer *this, TIMER_ROUTINE pCallback, void *pArgs);
171171
#endif
@@ -229,7 +229,7 @@ typedef struct {
229229

230230
static int Amp_Export(Amp *this, int compId, int id, char axis);
231231
static void Amp_Init(Amp *this);
232-
static void Amp_Refresh(Amp *this, long period, rtapi_u32 readyDelay);
232+
static void Amp_Refresh(Amp *this, long period, rtapi_uint readyDelay);
233233

234234

235235
/******************************************************************************
@@ -617,12 +617,12 @@ Plc_ExportLimits(Plc *this, int compId, int id)
617617
// Export optional parameters.
618618
if(debug > 0){
619619
if(!error){
620-
error = hal_param_new_ui32(compId, HAL_RO, &this->xLimit.stateDebug, 0,
620+
error = hal_param_new_uint(compId, HAL_RO, &this->xLimit.stateDebug, 0,
621621
"boss_plc.%d.%c-limit-state", id, axisNames[0]);
622622
}
623623

624624
if(!error){
625-
error = hal_param_new_ui32(compId, HAL_RO, &this->yLimit.stateDebug, 0,
625+
error = hal_param_new_uint(compId, HAL_RO, &this->yLimit.stateDebug, 0,
626626
"boss_plc.%d.%c-limit-state", id, axisNames[1]);
627627
}
628628
}
@@ -637,7 +637,7 @@ Plc_ExportAmps(Plc *this, int compId, int id)
637637
int error, i;
638638
Amp *pAmp;
639639

640-
error = hal_pin_new_ui32(compId, HAL_IO, &this->ampReadyDelay, 50,
640+
error = hal_pin_new_uint(compId, HAL_IO, &this->ampReadyDelay, 50,
641641
"boss_plc.%d.amp-ready-delay", id);
642642

643643
pAmp = this->amps;
@@ -655,11 +655,11 @@ Plc_ExportSpindle(Plc *this, int compId, int id)
655655
int error;
656656

657657
// Export parameters.
658-
error = hal_pin_new_ui32(compId, HAL_IO, &this->brakeOnDelay, 300,
658+
error = hal_pin_new_uint(compId, HAL_IO, &this->brakeOnDelay, 300,
659659
"boss_plc.%d.brake-on-delay", id);
660660

661661
if(!error){
662-
error = hal_pin_new_ui32(compId, HAL_IO, &this->brakeOffDelay, 500,
662+
error = hal_pin_new_uint(compId, HAL_IO, &this->brakeOffDelay, 500,
663663
"boss_plc.%d.brake-off-delay", id);
664664
}
665665

@@ -671,7 +671,7 @@ Plc_ExportSpindle(Plc *this, int compId, int id)
671671
// Export optional parameters.
672672
if(debug > 0){
673673
if(!error){
674-
error = hal_param_new_ui32(compId, HAL_RO, &this->spindleStateDebug, 0,
674+
error = hal_param_new_uint(compId, HAL_RO, &this->spindleStateDebug, 0,
675675
"boss_plc.%d.spindle-state", id);
676676
}
677677
}
@@ -782,9 +782,9 @@ Plc_Refresh(void *arg, long period)
782782
Plc_RefreshJog(this, period);
783783

784784
if(debug > 0) {
785-
hal_set_ui32(this->spindleStateDebug, this->spindleState);
786-
hal_set_ui32(this->xLimit.stateDebug, this->xLimit.state);
787-
hal_set_ui32(this->yLimit.stateDebug, this->yLimit.state);
785+
hal_set_uint(this->spindleStateDebug, this->spindleState);
786+
hal_set_uint(this->xLimit.stateDebug, this->xLimit.state);
787+
hal_set_uint(this->yLimit.stateDebug, this->yLimit.state);
788788
}
789789
}
790790

@@ -855,7 +855,7 @@ Plc_RefreshAmps(Plc *this, long period)
855855

856856
pAmp = this->amps;
857857
for(i = 0; i < NUM_AXIS; i++, pAmp++){
858-
Amp_Refresh(pAmp, period, hal_get_ui32(this->ampReadyDelay));
858+
Amp_Refresh(pAmp, period, hal_get_uint(this->ampReadyDelay));
859859
}
860860
}
861861

@@ -870,7 +870,7 @@ Plc_RefreshSpindle(Plc *this, long period)
870870
if(!hal_get_bool(this->pBrakeEnIn)){
871871
this->spindleState = SS_WAIT_BRAKE_OFF;
872872
hal_set_bool(this->pBrakeEnOut, 0);
873-
Timer_SetTimeout(&this->spindleTimer, hal_get_ui32(this->brakeOffDelay));
873+
Timer_SetTimeout(&this->spindleTimer, hal_get_uint(this->brakeOffDelay));
874874
Timer_Enable(&this->spindleTimer, TM_ONE_SHOT);
875875
}
876876
break;
@@ -927,7 +927,7 @@ Plc_RefreshSpindle(Plc *this, long period)
927927
if(!hal_get_bool(this->pSpindleIsOnIn)){
928928
this->spindleState = SS_WAIT_BRAKE_ON;
929929

930-
Timer_SetTimeout(&this->spindleTimer, hal_get_ui32(this->brakeOnDelay));
930+
Timer_SetTimeout(&this->spindleTimer, hal_get_uint(this->brakeOnDelay));
931931
Timer_Enable(&this->spindleTimer, TM_ONE_SHOT);
932932
}
933933
break;
@@ -1123,7 +1123,7 @@ Amp_Init(Amp *this)
11231123

11241124

11251125
static void
1126-
Amp_Refresh(Amp *this, long period, rtapi_u32 readyDelay)
1126+
Amp_Refresh(Amp *this, long period, rtapi_uint readyDelay)
11271127
{
11281128
Timer_Update(&this->timer, period);
11291129

@@ -1204,7 +1204,7 @@ Timer_Update(Timer *this, long period)
12041204

12051205

12061206
static void
1207-
Timer_SetTimeout(Timer *this, rtapi_u32 timeout)
1207+
Timer_SetTimeout(Timer *this, rtapi_uint timeout)
12081208
{
12091209
this->count = 0;
12101210
this->timeout = timeout;

0 commit comments

Comments
 (0)