mirror of
https://github.com/mist64/perfect6502.git
synced 2024-12-29 02:31:21 +00:00
cleanup
This commit is contained in:
parent
eee151c3ec
commit
446774eaa3
@ -404,45 +404,31 @@ typedef struct {
|
|||||||
* 3. if there is a pullup node, it's 1
|
* 3. if there is a pullup node, it's 1
|
||||||
* 4. if there is a pulldown node, it's 0
|
* 4. if there is a pulldown node, it's 0
|
||||||
* 5. otherwise, if there is an 1/floating node, it's 1/floating
|
* 5. otherwise, if there is an 1/floating node, it's 1/floating
|
||||||
* 6. otherwise, it's 0/floating (if there is a 0/floating node,
|
* 6. otherwise, it's 0/floating
|
||||||
* which is always the case)
|
|
||||||
*/
|
*/
|
||||||
static inline state_t
|
static inline state_t
|
||||||
getNodeValue()
|
getNodeValue()
|
||||||
{
|
{
|
||||||
state_t state = { .value = 0, .floating = 0 };
|
if (group_contains(vss))
|
||||||
|
return (state_t) { .value = 0, .floating = 0 };
|
||||||
|
|
||||||
if (group_contains(vss)) {
|
if (group_contains(vcc))
|
||||||
state.value = 0;
|
return (state_t) { .value = 1, .floating = 0 };
|
||||||
state.floating = 0;
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (group_contains(vcc)) {
|
BOOL contains_hi = NO;
|
||||||
state.value = 1;
|
|
||||||
state.floating = 0;
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
state.value = 0;
|
|
||||||
state.floating = 1;
|
|
||||||
|
|
||||||
for (count_t i = 0; i < group_count(); i++) {
|
for (count_t i = 0; i < group_count(); i++) {
|
||||||
nodenum_t nn = group_get(i);
|
nodenum_t nn = group_get(i);
|
||||||
if (get_nodes_pullup(nn)) {
|
if (get_nodes_pullup(nn))
|
||||||
state.value = 1;
|
return (state_t) { .value = 1, .floating = 0 };
|
||||||
state.floating = 0;
|
|
||||||
return state;
|
if (get_nodes_pulldown(nn))
|
||||||
}
|
return (state_t) { .value = 0, .floating = 0 };
|
||||||
if (get_nodes_pulldown(nn)) {
|
|
||||||
state.value = 0;
|
if (get_nodes_state_value(nn))
|
||||||
state.floating = 0;
|
contains_hi = YES;
|
||||||
return state;
|
|
||||||
}
|
|
||||||
if (get_nodes_state_value(nn) && get_nodes_state_floating(nn))
|
|
||||||
state.value = 1;
|
|
||||||
}
|
}
|
||||||
return state;
|
return (state_t) { .value = contains_hi, .floating = 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user